Draft: Add a versions selector for search results
What does this MR do and why?
Adds the Versions menu to the Search page, and rewrites result links to point to the selected version.
Closes #1371 (closed)
Screenshots, screen recordings, or links to review app
Review app: https://sarahg-gps-versions.docs.gitlab-review.app/search/?query=rake%20task
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 and compile the site with a Google search backend:
make clean && GOOGLE_SEARCH_KEY="AIzaSyAUCkVNs7JsHYKISjVrVv1PGXg9WQr1MCQ" SEARCH_BACKEND="google" bundle exec nanoc compile
- Start the web server (
bundle exec nanoc view
) and run a search. - Links should be relative (pointing to your local copy) and not include any version prefixes.
- This is clunky, but the best way I can think of to manually test an old version: modify
layouts/head.html
to use<meta name="gitlab-docs-version" content="15.9">
instead of<meta name="gitlab-docs-version" content="<%= site_version %>">
- Re-compile the site:
make clean && GOOGLE_SEARCH_KEY="AIzaSyAUCkVNs7JsHYKISjVrVv1PGXg9WQr1MCQ" SEARCH_BACKEND="google" bundle exec nanoc compile
- Run a search and verify that links point to pages on docs.gitlab.com/15.9.
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