If the breadcrumb is the last item in the breadcrumb trail, item is not required. If item isn't included for the last item, Google uses the URL of the containing page.
Currently, providing an item for every breadcrumb is required in this library. This makes adding the final breadcrumb more difficult since you have to manually add the current url. I wish BreadCrumbJsonLdProps => ItemListElements => item would be optional. That way it would more closely follow Google's recommendation, and the final url would be added for you automatically.
The Google SEO doc for adding breadcrumbs says
Currently, providing an
item
for every breadcrumb is required in this library. This makes adding the final breadcrumb more difficult since you have to manually add the current url. I wishBreadCrumbJsonLdProps => ItemListElements => item
would be optional. That way it would more closely follow Google's recommendation, and the final url would be added for you automatically.An example output would be:
Related to https://github.com/garmeeh/next-seo/issues/95
The new prop types could look like:
or maybe something like this instead to capture that it should only be for the last one:
I realize this isn't entirely trivial to add because of how
setItemListElements
is used, but would be a nice addition! Thank you :)