tags |
---|
vue, nuxt, CICD |
- Generate static pages with nuxi generate
- Get the list of distinct page routes from the generated HTML files
- Run html-validator for each distinct page route and create the report
🚧 WIP: Still a work in progress. The script below does not quite work properly, but it's on the righ track
1. Generate static pages with nuxi generate
npx nuxi generate
pages=$(find . -name '*.html' -print0 | xargs -0 -n 1 basename | cut -d'.' -f1 | sort -u)
for page in $pages; do
echo "Validating page: $page"
npx html-validator --input dist/$page.html >> html-validator-report.txt 2>&1
done
# Generate static pages
npx nuxi generate
# Get the list of distinct page routes from the generated HTML files
pages=$(find dist -name '*.html' -print0 | xargs -0 -n 1 basename | cut -d'.' -f1 | sort -u)
# Run html-validator for each distinct page route and create the report
echo "Running HTML validator on generated pages..."
for page in $pages; do
echo "Validating page: $page"
npx html-validator --input dist/$page.html --logLevel verbose >> html-validator-report.txt 2>&1
done
echo "HTML validation report generated in html-validator-report.txt"