Skip to content

Update breadcrumb separator

Sarah German requested to merge 1678-breadcrumb-rspec into main

What does this MR do and why?

Fixes a minor bug with the recently-added breadcrumb metatag (!4063 (merged)). Turns out we can't use a comma as the breadcrumb separator because some pages have a comma in the title (like this one).

You can see the bug in action on the review app for the frontend breadcrumb MR in the first result: https://gps-page-trail.docs.gitlab-review.app/search/?q=hugo&page=1 (words in the page title appear as separate pages in the breadcrumb).

This MR:

  1. Changes the breadcrumb separator from a comma to › (HTML entity for these things: ›). We're going to display the breadcrumb with these anyways, and unlike a comma, that arrow character should not ever be in a page title. As a follow-up we can use Vale to check for that (currently there are no pages with these in the title).
  2. Adds a test to check the breadcrumb metatag's content and formatting.

Closes #1678 (closed)

Screenshots, screen recordings, or links to review app

Before After
image image

Example pages:

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. Compile the site
  3. Inspect the HTML source and look at the gitlab-docs-breadcrumb metatag. These should reflect the page's position in the global navigation, with each page in the hierarchy separated by a ›

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 #1678 (closed)

Edited by Sarah German

Merge request reports