2020-03-29 21:18:30 +02:00
|
|
|
returncode=0
|
|
|
|
|
|
|
|
# Find all markdown links and generate a list of filename.md:N:linktarget (with N the line number)
|
|
|
|
for LINK in $(grep -nr -o -E "\]\(\/?(\w|-)+\)" ./*.md | tr -d ']()/')
|
|
|
|
do
|
|
|
|
PAGE=$(echo $LINK | awk -F: '{print $3}')
|
2020-05-24 16:59:52 +02:00
|
|
|
[ -e "$PAGE.md" ] || echo "This Markdown link looks dead (page doesn't exist in english?) $LINK"
|
2020-03-29 21:18:30 +02:00
|
|
|
[ -e "$PAGE.md" ] || returncode=1
|
|
|
|
done
|
|
|
|
|
|
|
|
# Find all HTML/href links and generate a list of filename.md:N:linktarget (with N the line number)
|
|
|
|
for LINK in $(grep -nr -o -E 'href="\/?(\w|-)+\"' ./*.md | sed -E 's@href="/?@@g' | tr -d '"')
|
|
|
|
do
|
|
|
|
PAGE=$(echo $LINK | awk -F: '{print $3}')
|
2020-05-24 16:59:52 +02:00
|
|
|
[ -e "$PAGE.md" ] || echo "This HTML link looks dead (page doesn't exist in english?) $LINK"
|
2020-03-29 21:18:30 +02:00
|
|
|
[ -e "$PAGE.md" ] || returncode=1
|
|
|
|
done
|
|
|
|
|
|
|
|
exit $returncode
|