Have you read the Contributing Guidelines on issues?
Prerequisites
Description
If a breadcrumb item (such as a category item in the sidebar) has no link (and thus no href) the generated SEO microdata is invalid. Since the generator is designed to pick an href and use it as the id, it looks like if there's no href to take it default to whatever text is visible inside the element.
So, if you have, e.g. a sidebar with nested items:

Then the generated breadcrumbs have no links associated to them. The generator takes, in this case "MCU Guides" as its ID, which is apparently invalid:

In these cases, I think it would be appropriate to not add an ID property at all.
Reproducible demo
No response
Steps to reproduce
- Add a nested sidebar to Docusaurus:
// E.g. in sidebar.js
module.exports = {
docs: {
"Some Category": {
type: "category",
label: "Some Label",
items: [
"some-category/actual-docs"
]
}
}
};
- Run the Google rich results validator on the resulting page: https://search.google.com/test/rich-results
Confirm that the ID of the SEO microdata is Some Category, which is invalid.
Expected behavior
No ID gets added in the generated SEO microdata for breadcrumbs without an href.
Actual behavior
An invalid ID gets added, using the text value from the category breadcrumb, because there's no href to take from.
Your environment
Self-service
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clearoryarn clearcommand.rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages.Description
If a breadcrumb item (such as a category item in the sidebar) has no link (and thus no
href) the generated SEO microdata is invalid. Since the generator is designed to pick anhrefand use it as theid, it looks like if there's nohrefto take it default to whatever text is visible inside the element.So, if you have, e.g. a sidebar with nested items:
Then the generated breadcrumbs have no links associated to them. The generator takes, in this case
"MCU Guides"as its ID, which is apparently invalid:In these cases, I think it would be appropriate to not add an ID property at all.
Reproducible demo
No response
Steps to reproduce
Confirm that the ID of the SEO microdata is
Some Category, which is invalid.Expected behavior
No ID gets added in the generated SEO microdata for breadcrumbs without an
href.Actual behavior
An invalid ID gets added, using the text value from the category breadcrumb, because there's no
hrefto take from.Your environment
Self-service