voorhoede / head-start

Base setup on top of headless services to help you quickly start a new website
ISC License
3 stars 0 forks source link

chore: validate (lint) production build HTML files #63

Closed jbmoelker closed 7 months ago

jbmoelker commented 8 months ago

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

cloudflare-pages[bot] commented 8 months ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: c375c55
Status:🚫  Build failed.

View logs

jbmoelker commented 8 months ago

This PR would be a good extension to #58 from which it reuses part of the setup.

jbmoelker commented 7 months ago

Regression on package-lock.json issues. Closing in favour of #100 .