Add page section as a metatag
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 |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/setup.md. -
Check out this branch, compile and preview the site: git fetch --all && git checkout section-metatag && make view
-
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 nocontent
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.
-
I have evaluated the MR acceptance checklist for this merge request.
Edited by Sarah German