Implement linkcheck

Signed-off-by: nιcнolaѕ wιlde <ncwilde43@gmail.com>
This commit is contained in:
nιcнolaѕ wιlde
2022-06-09 05:26:28 +00:00
parent f4b0a1c0e7
commit 5d1e517e1c
3 changed files with 14 additions and 0 deletions

View File

@ -12,6 +12,10 @@ tasks:
--dev-addr 0.0.0.0:{{ .PORT }} -f ./mkdocs.yml
vars:
PORT: 8000
linkcheck:
desc: Check for dead links
cmds:
- ./scripts/linkcheck.sh
lint:
desc: Lint the project
cmds:

3
mlc_config.json Normal file
View File

@ -0,0 +1,3 @@
{
"aliveStatusCodes": [200, 206, 403, 429]
}

7
scripts/linkcheck.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
set -e
set -o pipefail
readonly DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" >/dev/null 2>&1 && pwd )
for f in $(find "${DIR}" -not -path '*.github*' -name \*.md); do
docker run --rm -v /:/tmp:ro -i -w /tmp ghcr.io/tcort/markdown-link-check:stable "/tmp/${f}" -c "/tmp${DIR}/mlc_config.json" || exit 1
done