Skip to content

Refactor versions menu for use on Archives site

Sarah German requested to merge sarahg/1290-archives-version-menu into main

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
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 and turn on the local dev server with bundle exec nanoc view
  2. Emulate being on archives.docs.gitlab.com by editing the isArchives function in content/frontend/default/environment.js like this:
export function isArchives() {
  return true;
  //return window.location.host === GlHosts.find((x) => x.environment === 'archives').host;
}
  1. Recompile frontend code: yarn bundle
  2. 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.

Edited by Sarah German

Merge request reports