Refactor versions menu for use on Archives site
What does this MR do and why?
Updates the Versions menu component for use on the future archives.docs.gitlab.com site and self-hosted instances.
Currently, this menu does not appear on any host besides docs.gitlab.com and localhost. This MR adjusts the menu to appear on other domains, but without the additional version options we show on the production docs.gitlab.com site (since those won't exist in other environments).
Closes #1290 (closed)
Screenshots, screen recordings, or links to review app
before | after |
---|---|
![]() |
![]() |
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 and turn on the local dev server with bundle exec nanoc view
-
Emulate being on archives.docs.gitlab.com by editing the isArchives
function incontent/frontend/default/environment.js
like this:
export function isArchives() {
return true;
//return window.location.host === GlHosts.find((x) => x.environment === 'archives').host;
}
-
Recompile frontend code: yarn bundle
-
Verify the Versions menu now only shows the current site version + archives link.
You'll need to view the local site at http://localhost:3000, not http://127.0.0.1:3000, to see the menu.
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