Skip to content

Add handling for page-level redirects

Sarah German requested to merge 30-page-redirects into main

What does this MR do and why?

Resolves the first to-do in #30 (closed).

This MR adds handling for pages that have redirect_to in the frontmatter. The process for contributors will not change from how we currently handle this: https://docs.gitlab.com/ee/development/documentation/redirects.html

Why not use Hugo's method for these?

Hugo does have a built-in method for redirects called Aliases, but our redirects also have to work in /help, so we'll need to continue using redirect_to. There is also tooling in gitlab already to support creating these quickly.

Screenshots, screen recordings, or links to review app

Before After (actual redirect happens)
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. Visit a page that has a redirect set in its front matter. You can find them with a search like this: grep -rnw ../gitlab/doc -e 'redirect_to'

Some examples:

These pages should redirect over to their new location (whatever redirect_to is set to).

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

Loading