Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML5 validation failures #33

Closed
dijitali opened this issue Jun 22, 2021 · 2 comments
Closed

HTML5 validation failures #33

dijitali opened this issue Jun 22, 2021 · 2 comments

Comments

@dijitali
Copy link

Just having a play with this theme (thanks for your work, it looks awesome!) and spotted a couple of minor things are currently being flagged by the W3C HTML Validator:

image

  1. It's apparently invalid to use http-equiv for any HTTP header, only those listed in the Pragma directives here
  2. Use of the itemprop attribute requires the itemscope and itemtype to be defined.

I'm happy to pop some PRs up for these but I also wondered if you'd like the idea/would accept a PR to add a Github Action to automatically validate the build of the example site with the checker going forward?

@janraasch
Copy link
Owner

Hi @dijitali, thank you for getting in touch 👋.

http-equiv

This might not be »valid«, but it's just a fun meta-tag we inherited from the original bearblog. See

The source code is here: https://github.com/HermanMartinus/bearblog/blob/master/templates/base.html#L5.

ℹ️ Here's the story behind this non-standardised HTTP header: https://xclacksoverhead.org/home/about

itemprop

This one baffles me a little bit. We are using Hugos very own _internal/schema.html-template here. The code is over at https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/schema.html.

I went and checked what's up on the Hugo News-blog and they actually use it just in exactly the same way we do. Thus they get the same error on the w3c-validator, see https://validator.w3.org/nu/?doc=https%3A%2F%2Fgohugo.io%2Fnews%2F

If you want to persue this further I'd suggest opening up an issue on the main Hugo repo, which includes the _internal/schema.html-template, so this can be fixed centrally.

➡️ Thus - I think - we'll just have to live with these errors on the validator (for now?).


If you have a requirement for your personal website to be 100% valid against the w3c-validator you may overwrite the

  • baseof.html (This includes the non-valid header) and
  • seo_tags.html (This includes the non-valid item props)

templates locally.

I hope that helps 🙏.

Kind regards and have a good weekend 🏝.

@dijitali
Copy link
Author

Thanks for such a considered response! Totally on board with you on both these points, I just hadn't realised how much was inherited by this repo.

The first one would be ideal if it could be set as an actual HTTP response header but totally outside the scope of this and it looks like the second point has already been raised as a Hugo bug in gohugoio/hugo#7431.

Hope you have a great weekend too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants