Last active
February 24, 2023 13:44
-
-
Save digitalbricklayer/f46b889d55a7e17ade3672f9698b3b65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Check all internal links on the dev site | |
# default port used when `hugo serve` command is used | |
SITE_URL="http://localhost:1313" | |
# Start the test server in daemon mode | |
# so as not to block the script | |
docker-compose up -d | |
# Wait for the test server to start up | |
until $(curl --output /dev/null --silent --head --fail $SITE_URL/); do | |
printf '.' | |
sleep 1 | |
done | |
# To check external links add: | |
# --ignore-url=https://fonts.gstatic.com \ | |
# --check-extern \ | |
docker run --rm -it --network="host" -u $(id -u):$(id -g) \ | |
ghcr.io/linkchecker/linkchecker:latest \ | |
--ignore-url=/dist --no-status \ | |
$SITE_URL/ | |
docker-compose down |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment