mirror of
https://github.com/nicholaswilde/recipes.git
synced 2025-12-01 12:36:44 +00:00
Implement linkcheck
Signed-off-by: nιcнolaѕ wιlde <ncwilde43@gmail.com>
This commit is contained in:
@ -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
3
mlc_config.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"aliveStatusCodes": [200, 206, 403, 429]
|
||||
}
|
||||
7
scripts/linkcheck.sh
Executable file
7
scripts/linkcheck.sh
Executable 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
|
||||
Reference in New Issue
Block a user