Skip to content

Commit cfb014d

Browse files
Add a procedure for creating a redirect that passes CI checks (#1893)
* Add a procedure for creating a redirect that passes CI checks * Update docs/contribute/redirects.md * Update docs/contribute/redirects.md * Update docs/contribute/redirects.md Co-authored-by: Liam Thompson <[email protected]> * Update docs/contribute/redirects.md Co-authored-by: Liam Thompson <[email protected]> --------- Co-authored-by: Liam Thompson <[email protected]>
1 parent 0d84175 commit cfb014d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

docs/contribute/redirects.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,29 @@ For API redirects, consult with the documentation engineering team on Slack (#el
1616

1717
For elastic.co/guide redirects, open a [web team request](http://ela.st/web-request).
1818

19+
## Add a redirect
20+
21+
To successfully implement a redirect:
22+
23+
1. Locate and open the `redirects.yml` file to edit.
24+
- Each docs repository powered by Docs V3 can have its own `redirects.yml` file. You must only edit the one in the repository that you're moving or removing files from.
25+
- It is at the same location as the `docset.yml` file. Depending on the repository, this is generally at the root or within the `/docs` folder of the repository.
26+
27+
:::{note}
28+
Some repositories might not yet have a `redirects.yml` file. In this case, create one next to the repo's `docset.yml` file. Refer to [](#file-location).
29+
:::
30+
31+
2. Edit the file. Refer to [](#syntax) to get details on the expected syntax.
32+
- All paths must be relative to the `redirects.yml` file.
33+
- You may need to adjust the syntax based on how you'd like to treat anchors within redirected files. Find examples in [](#syntax).
34+
35+
3. Fix all existing links to the moved or removed file within the repository where you're adding the redirect, by updating them to the new correct target, or by removing them if necessary. This is a best practice to keep our content healthy, and mandatory for your PR to pass CI checks.
36+
37+
4. Create a PR with all of the changes made through the previous steps.
38+
39+
CI checks run to validate the newly added redirect and the docs build.
40+
If you get validation errors about the redirect, double check that your changes follow all the steps in this procedure. If the errors persist after a writer reviewed the PR, ask @elastic/docs-engineering for assistance.
41+
1942
## Validation
2043

2144
Running `docs-builder diff validate` will give you feedback on whether all necessary redirect rules are in place after your changes. It will also run on pull requests.

0 commit comments

Comments
 (0)