Skip to content

Add page section as a metatag

Sarah German requested to merge section-metatag into main

What does this MR do and why?

Adds a metatag noting the top-level nav section of each page. We'll be able to use this for #1311 (closed)

Screenshots, screen recordings, or links to review app

Review app: https://section-metatag.docs.gitlab-review.app/ee/user/project/repository/

Screenshots:

Page in the nav Page not in the nav
image image

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. Check out this branch, compile and preview the site: git fetch --all && git checkout section-metatag && make view
  3. View a few pages and check for the gitlab-docs-section metatag. It should look something like this in the page source:
<meta name="gitlab-docs-section" content="Install GitLab">
  • The content value will vary depending on the page's top-level nav section.
  • Pages without a top-level nav section (e.g, the homepage, or something that is not in the menu like /archives) should have the tag, but no content value.

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.

Edited by Sarah German

Merge request reports