Skip to content

Use relative links for search results

Sarah German requested to merge 1378-search-relative-urls into main

What does this MR do and why?

Modifies search result links to be relative rather than always pointing to docs.gitlab.com. This is useful when testing search locally or on review apps.

Screenshots, screen recordings, or links to review app

n/a

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.
  2. Compile with Google as the search backend:
make clean && GOOGLE_SEARCH_KEY="AIzaSyAUCkVNs7JsHYKISjVrVv1PGXg9WQr1MCQ" SEARCH_BACKEND="google" bundle exec nanoc compile 
  1. View the site (bundle exec nanoc view) and run a search.
  2. Verify result links keep you within the current domain (e.g, localhost:3000 or the review app).

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.

Merge request reports