From 5a56594f0ca6ebbb627124d6f63a9903a5e78f67 Mon Sep 17 00:00:00 2001 From: Dan Cech Date: Thu, 22 Jul 2021 13:46:40 -0400 Subject: [PATCH] add instructions for managing redirects when moving docs pages around (#37113) --- docs/README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/README.md b/docs/README.md index 59077650fb1..4ebd6f0cc19 100644 --- a/docs/README.md +++ b/docs/README.md @@ -29,8 +29,17 @@ Syntax is: {{< relref "example.md" >}} ``` -You might need to add more context for the link (containing folders and so on, `folder/example.md`) if Hugo says the relref is ambiguous. +You might need to add more context for the link (containing folders and so on, `folder/example.md`) if Hugo says the relref is ambiguous. +### Managing redirects + +When moving content around or removing pages it's important that users following old links are properly redirected to the new location. We do this using the [aliases](https://gohugo.io/content-management/urls/#aliases) feature in Hugo. + +If you are moving a page, add an `aliases` entry in the front matter referencing the old location of the page which will redirect the old url to the new location. + +If you are removing a page, add an `aliases` entry in the front matter of the most-applicable page referencing the location of the page being removed. + +If you are copying an existing page as the basis for a new one, be sure to remove any `aliases` entries in the front matter in your copy to avoid conflicting redirects. ### Edit the side menu