- scripts/check-wiki-links.py: validates all [[...]] links source-relative (matching Forgejo behavior)
- scripts/fix-wiki-links.py: auto-rewrites broken links as source-relative paths
- scripts/.check-wiki-links-wrapper.sh: pre-commit hook wrapper
- .git/hooks/pre-commit: installs wrapper as Git hook
- Fixed 47 wiki files with broken links (mostly path-confusion and wiki/-prefix bugs)
- Total: 691 valid wiki links, 0 broken, 0 path confusion
- Manual fix: Wikipedia: Sleeper agent link → proper Markdown URL
- Manual fix: non-existent decision link → decisions-index
- Code-span and template-placeholder handling (ignores `[[example]]` and `[[{slug}]]`)
Trigger: k9ert noted https://.../concepts/llm/concepts/llm/... was 404 in wiki-catalog
6 lines
181 B
Bash
Executable file
6 lines
181 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Pre-commit hook: validate all wiki links before commit
|
|
set -e
|
|
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
cd "$REPO_ROOT"
|
|
python3 scripts/check-wiki-links.py
|