Skip to content

Add breadcrumb metadata to pages

Sarah German requested to merge 1370-breadcrumb-metadata into main

What does this MR do and why?

Adds navigation metadata for each page per the schema.org breadcrumbList spec. This is used by search engines and can also be used in our own site search results. This will allow for visitors to better differentiate pages with similar titles in search results.

Screenshots, screen recordings, or links to review app

level 1 menu item level 2 menu item level 6 menu item
image image image

Note: On the review app (and production), HTML is minified, so these won't have line breaks or indentation (but should still pass the validator test).

Example review app URLs:

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md.
  2. Inspect HTML source for pages of a few varying levels in the navigation. Check that items in the BreadcrumbList JSON object properly reflect the hierarchy of the page in the global nav.
  3. Check that the JSON object is valid by copy/pasting into the "code snippet" tab of the Schema Markup Validator: https://validator.schema.org/

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Closes #1370 (closed)

Edited by Sarah German

Merge request reports