2018-07-12 16:26:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
PATH_TO_SITE="/app/site"
|
|
|
|
[ -d "${PATH_TO_SITE}" ]
|
|
|
|
|
|
|
|
NUMBER_OF_CPUS="$(grep -c processor /proc/cpuinfo)"
|
|
|
|
|
|
|
|
|
|
|
|
echo "=== Checking HTML content..."
|
|
|
|
|
|
|
|
# Search for all HTML files except the theme's partials
|
|
|
|
# and pipe this to htmlproofer with parallel threads
|
|
|
|
# (one htmlproofer per vCPU)
|
|
|
|
find "${PATH_TO_SITE}" -type f -not -path "/app/site/theme/*" \
|
|
|
|
-name "*.html" -print0 \
|
|
|
|
| xargs -0 -r -P "${NUMBER_OF_CPUS}" -I '{}' \
|
|
|
|
htmlproofer \
|
|
|
|
--check-html \
|
2018-07-25 15:58:02 +00:00
|
|
|
--only_4xx \
|
2018-07-12 16:26:03 +00:00
|
|
|
--alt_ignore="/traefik.logo.png/" \
|
|
|
|
--url-ignore "/localhost:/,/127.0.0.1:/,/fonts.gstatic.com/,/.minikube/,/github.com\/containous\/traefik\/*edit*/,/github.com\/containous\/traefik\/$/" \
|
|
|
|
'{}'
|
|
|
|
## HTML-proofer options at https://github.com/gjtorikian/html-proofer#configuration
|
|
|
|
|
|
|
|
echo "= Documentation checked successfuly."
|