Issue #6 rightly states, each page must only have a single h1 and headings should not skip a level.
This PR introduces lint:html which uses html-validate to check the HTML pages of the production build.
It correctly finds these issues:
> head-start@0.0.1 lint:html
> html-validate dist/
/home/runner/work/head-start/head-start/dist/en/page-1/index.html
Error: 3:774 error Multiple <h1> are not allowed heading-level
Error: 3:810 error Heading level can only increase by one, expected <h3> but got <h4> heading-level
✖ 2 problems (2 errors, 0 warnings)
More information:
https://html-validate.org/rules/heading-level.html
Error: Process completed with exit code 1.
But, what do we want to do with that? Because these issues are caused by a content editor using incorrect semantics in the CMS. However failing the build and then checking the logs isn't really a viable option.
Update: now partially resolved by #81 .
Changes
Associated issue
Part of #6
How to test
Checklist
[ ] I have performed a self-review of my own code
[ ] I have made sure that my PR is easy to review (not too big, includes comments)
[ ] I have added/updated tests to prove that my feature works (if not possible please explain why)
[ ] I have made changes to the README and if the change affects the project setup (npm commands changed, new service added, environmental variable added)
[ ] I have added a decision log entry if the change affects the architecture or changes a significant technology
Issue #6 rightly states, each page must only have a single
h1
and headings should not skip a level. This PR introduceslint:html
which useshtml-validate
to check the HTML pages of the production build. It correctly finds these issues:But, what do we want to do with that? Because these issues are caused by a content editor using incorrect semantics in the CMS. However failing the build and then checking the logs isn't really a viable option.
Update: now partially resolved by #81 .
Changes
Associated issue
Part of #6
How to test
Checklist