mkdocs-semiliterate/tests/sites.bash
Glen Whitney 8105144d82 chore: Allow building from venv; bump version (#24)
Also had to update the test fixtures because mkdocs, bootstrap, whatever it may be have changed, so the sites end up slightly different.

Reviewed-on: #24
Co-authored-by: Glen Whitney <glen@studioinfinity.org>
Co-committed-by: Glen Whitney <glen@studioinfinity.org>
2024-09-15 18:49:57 +00:00

21 lines
646 B
Bash

set -e
shopt -s globstar
startdir=$PWD
for file in tests/fixtures/*
do
echo "Testing $startdir/$file"
cd "$startdir/$file"
mkdocs -v build -s
# unfortunately MkDocs writes the run date in the last few lines of index
# and has version numbers in some of the scripts that are irrelevant:
for hml in **/*.html
do
grep -v MkDocs.version $hml | grep -v Build.Date.UTC | grep -v '[</]script[ >]' | grep -v '[</]link' > "$hml.cropped"
rm $hml
done
diff -r -x img -x '*fonts*' -x js -x '*.xml*' refsite site
echo "Site in $file built successfully"
rm -r site
done
echo "All site tests passed."