gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
76.07k stars 7.54k forks source link

Update, document, or remove internal Schema.org template #7431

Open mpctx opened 4 years ago

mpctx commented 4 years ago
$ hugo version
Hugo Static Site Generator v0.73.0-428907CC/extended darwin/amd64 BuildDate: 2020-06-23T16:37:47Z

The current schema template does not define itemscope and itemtype, which are required for it to be valid. If you submit a page with the current meta tags to W3.org Validator you will see errors:

The itemprop attribute was specified, but the element is not a property of any item.

If you run the HTML through Google Structured Data Testing Tool no data will be parsed because it requires the above mentioned properties.

The wordCount meta entry in the template is only for the Article schema type, but if you set the type to Article in Google's tool, it will tell you it also requires "author", "headline", "publisher" which are not included in the template. The additional required fields that are included in the template, "datePublished" and "image", aren't required in the template.

In its current form, the template does not provide valid Schema.org structures. For users that are unfamiliar with Schema data structures it is adding HTML that won't validate and additional data that will not actually be parsed.

This template is mentioned, but not documented so users are not aware of the above issues. I feel documenting the template does little because the user still has to add several pieces of data to Params or frontmatter for anything meaningful to be added. The type of page is not as generic as OpenGraph (4 choices vs dozens in Schema)(ie "Article" is not always what I would consider "IsPage==True" to represent.)

earthboundkid commented 4 years ago

On my site, I have some funky LD-JSON templates. Would that be a good replacement for the current internal metadata templates? Or do users need both?

inwardmovement commented 4 years ago

I agree, see Understand how structured data works

XhmikosR commented 3 years ago

Perhaps after #3088 is sorted a new schema internal template could be added. For example https://codingnconcepts.com/hugo/structure-data-json-ld-hugo/

rootwork commented 3 years ago

@XhmikosR that issue doesn't seem to have made any significant progress in years. But thanks for that link to the structured data guide, that's very helpful!

XhmikosR commented 3 years ago

Yeah, but the authors situation needs to be standardized first... Right now the internal templates are broken when it comes to authors.

rootwork commented 3 years ago

Fair enough

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

earthboundkid commented 2 years ago

I think this is still relevant.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

earthboundkid commented 1 year ago

I am starting to think pretty much all the internal templates should be replaced with blessed external modules.

github-actions[bot] commented 7 months ago

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.