Add handling for page-level redirects
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) |
---|---|
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/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md. -
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:
- http://localhost:1313/user/application_security/dast_api/configuration/requirements.html
- http://localhost:1313/architecture/blueprints/rapid_diffs.html
- http://localhost:1313/administration/audit_event_types.html
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.
-
I have evaluated the MR acceptance checklist for this merge request.