Skip to content

Fix base path and title in search suggestions

Sarah German requested to merge search-touchups into main

What does this MR do and why?

Fixes two issues with search suggestions:

  1. The word "Docs" was being added to every history item. We want history items to only show the page title.
  2. Fixes the path to the Recommended page (CI/CD reference) when the site is running on a domain with a subdirectory (e.g a versioned site, or our dev site)

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/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md.
  2. Browse around the site and visit 4+ pages so that your history prior to this MR is cleared out (we store the page info in a cookie in your browser)
  3. Click in the search box to see your recent history items. They should only show the title
  4. Run the site with a subdirectory-style URL: make view-prod
  5. Visit a few pages and verify that the link to the CI/CD page in the search box goes to the CI/CD page

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