Open TimJentzsch opened 2 years ago
Did a little bit of research on this. pa11y
seems to be a good candidate and has a version explicitly for CI: pa11y-ci
.
I've done a local test with the tool and once installed it does work to catch accessibility issues on the site; technically more than even the Firefox accessibility tools showed me. Showed missing image alt text and told me the recommended color to use for each contrast issue.
One issue is that pa11y-ci had little bit of issues when I tested it compared to regular pa11y
This link has other recommendations for accessibility linters and useful things that should be considered https://www.digitala11y.com/free-accessibility-linters-to-automate-accessibility-workflow/
I'm not sure if there is an easy way to add this to Zola projects, but it would be nice to have basic accessibility checks in CI. Stuff like "every
img
element has analt
attribute" should be enough for the start.If Zola has anything built-in we could use that, otherwise maybe it's possible to do the linting on the generated HTML?