BreadcrumbList schema validation issue
The BreadcrumbList implementation in baseof.html causes schema validation errors as it doesn't align with the schema at https://www.schema.org/BreadcrumbList. This can be seen when validating the site at https://search.google.com/test/rich-results. I have confirmed the exampleSite also fails similarly.
I have overridden baseof.html on my site with the following changes to the BreadcrumbList, and have verified the issue goes away.
```
<ul vocab="https://schema.org/" typeof="BreadcrumbList">
{{ range $index, $element := .Site.Params.navlinks }}
<li property="itemListElement" typeof="ListItem">
<a property="item" typeof="WebPage" href="{{ absURL $element.url }}">
<span property="name">{{ .name }}</span></a>
<meta property="position" content="{{ add $index 1}}" />
</li>
{{ end }}
</ul>
```
Iam happy to create a PR if this helps.
In addition, it will be useful if we could add the navigation bar to a partial.
关闭于 2025-04-10 1 条评论