Skip to content

Automatically generated breadcrumb markup #7135

Description

@kotryna-k

Have you read the Contributing Guidelines on issues?

Description

We'd love to have the possibility to add the breadcrumb markup to all pages automatically. The breadcrumb markup enables Google to see the breadcrumb navigation on the website and display it in search results.

Has this been requested on Canny?

No, it hasn't been requested on Canny yet.

Motivation

We are a team of developers who use docusaurus for the documentation of our product. Our documentation is available to everyone on the internet. It helps new users to get acquainted with our product and dive deeper into its features.

Recently, we have set up breadcrumb navigation across all our documentation. Now we would like to provide Google with information about breadcrumbs so that Google can display it in search results.

What we need is to allow Google to see our breadcrumb navigation on every page of the documentation. As we have about thousands of pages, it looks like an enormous amount of work to add this markup manually. Thus, we’d love to have the possibility to generate it automatically.

API design

Here is an example of the breadcrumb markup:

<script type="application/ld+json">
{
 "@context": "https://schema.org",
 "@type": "BreadcrumbList",
 "itemListElement":
 [
  {
   "@type": "ListItem",
   "position": 1,
   "item":
   {
    "@id": "https://example.com/dresses",
    "name": "Dresses"
    }
  },
  {
   "@type": "ListItem",
  "position": 2,
  "item":
   {
     "@id": "https://example.com/dresses/real",
     "name": "Real Dresses"
   }
  }
 ]
}
</script>

, where:
position - the page’s position in the website structure
id - page link
name - h1 of the page

Please note that the last element of breadcrumb navigation shouldn’t have a link in the markup.
We have consulted the following resources on the breadcrumb markup: https://schema.org/BreadcrumbList and https://developers.google.com/search/docs/advanced/structured-data/breadcrumb.

Have you tried building it?

We haven't tried building it, because implementing such a feature is possible only under the hood of docusaurus.

Self-service

  • I'd be willing to contribute this feature to Docusaurus myself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed: duplicateThis issue or pull request already exists in another issue or pull requestfeatureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions