Skip to content

Use relative URLs for Algolia results

Sarah German requested to merge sarahg/algolia-relative-links into main

What does this MR do and why?

Rewrite Algolia result links so that they point to pages within the site you're on (review apps, localhost, or production) instead of always pointing to docs.gitlab.com.

This uses the transformItems method in the Algolia API: https://docsearch.algolia.com/docs/api/#transformitems

This should allow for easier testing of Algolia-related changes.

Screenshots, screen recordings, or links to review app

These are strongly recommended to assist reviewers and reduce the time to merge your change.

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. Run a search from any of the Algolia search instances (homepage, interior page navbar, /search) -- result links should point within your local site.

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