Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/htmlproofer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# .github/workflows/check-links.yml

name: Check Documentation Links

on:
pull_request:
branches: [main]
paths:
- 'docs/**'
- 'mkdocs.yml'
- 'requirements.txt'
push:
branches: [main]
workflow_dispatch:

jobs:
check-links:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install mkdocs-htmlproofer-plugin

- name: Check links
run: |
# Run build and check for broken links
mkdocs build 2>&1 | tee build.log

# Fail if any broken links found
if grep -q "invalid url" build.log; then
echo "❌ Broken links found!"
grep "invalid url" build.log
exit 1
fi

echo "✅ All links are valid!"
12 changes: 10 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
repos:
- repo: https://github.com/crate-ci/typos
rev: v1.33.1
rev: v1.34.0
hooks:
- id: typos
args: ["--config", ".typos.toml"]
args: ["--config", ".typos.toml"]
- repo: local
hooks:
- id: check-docs-links
name: Check documentation links
entry: mkdocs build
language: system
files: '^docs/.*\.(md|markdown)$'
pass_filenames: false
10 changes: 10 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,16 @@ plugins:
- components/anomaly-support/*
- components/comparators/*
- components/general-props/*
- htmlproofer:
raise_error: True
validate_external_urls: True
ignore_urls:
- "http://localhost.*"
- "http://127.0.0.1.*"
- "#"
- "https://your-company.atlan.com"
- "mailto://hello@qualytics.co"
- "../print_page/"
- git-revision-date-localized
- include-markdown
- macros
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
mkdocs-material==9.5.50
mkdocs-exclude==1.0.2
mkdocs-git-revision-date-localized-plugin==1.2.6
mkdocs-htmlproofer-plugin==1.3.0
mkdocs-include-markdown-plugin==6.0.2
mkdocs-macros-plugin==1.3.7
mkdocs-material==9.5.50
mkdocs-print-site-plugin==2.7.3
mkdocs-redirects==1.2.2
pre-commit==3.8.0
Loading