Add config to build a local archive version

What does this MR do and why?

  • Adds a new make target for running an archived version of the site (make view-archive)
    • Adds new yarn scripts for creating a Vite build with a versioned URL
    • Adjusts Pagefind config to use the versioned URL
  • Copies over version-related documentation (original version)
  • Adjusts template logic to work with archive version paths. Our checks for specific page paths need to be version-agnostic.
  • Adds logic to the Survey banner component so that it only appears if we're on the pre-release version of the site (site built from the main branch, not an archive)

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/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md.
  2. Start with a clean env: make clean
  3. Test the make target without an env var: make view-archive
    • Expected behavior: error message reminding you to set CI_COMMIT_REF_NAME
  4. Run the site with archive-style paths: CI_COMMIT_REF_NAME=15.2 make view-archive

Verify that version-related features work as expected:

  • Search uses pagefind (and returns results as expected)
  • Versions menu in the top-right shows the proper version number
  • If you enable the banner (update data/banner.yaml and set "enabled" to true), it should not appear (we never want to show this on archived versions)

Verify that path-related logic still works as expected:

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

Edited by Hiru Fernando

Merge request reports

Loading