Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
3642820b
Commit
3642820b
authored
Feb 09, 2021
by
Achilleas Pipinellis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document new way of _redirects file creation
parent
369eec50
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
7 deletions
+29
-7
doc/development/documentation/index.md
doc/development/documentation/index.md
+29
-7
No files found.
doc/development/documentation/index.md
View file @
3642820b
...
@@ -207,19 +207,41 @@ To add a redirect:
...
@@ -207,19 +207,41 @@ To add a redirect:
1. Assign the MR to a technical writer for review and merge.
1. Assign the MR to a technical writer for review and merge.
1. If the redirect is to one of the 4 internal docs projects (not an external URL),
1. If the redirect is to one of the 4 internal docs projects (not an external URL),
create an MR in [`gitlab-docs`](https://gitlab.com/gitlab-org/gitlab-docs):
create an MR in [`gitlab-docs`](https://gitlab.com/gitlab-org/gitlab-docs):
1. Update [`
_redirects`](https://gitlab.com/gitlab-org/gitlab-docs/-/blob/master/content/_redirects
)
1. Update [`
redirects.yaml`](https://gitlab.com/gitlab-org/gitlab-docs/-/blob/master/content/_data/redirects.yaml
)
with one redirect entry for each renamed or moved file. This code works for
with one redirect entry for each renamed or moved file. This code works for
<https://docs.gitlab.com> links only:
<https://docs.gitlab.com> links only
. Keep them alphabetically sorted
:
```plaintext
```yaml
/ee/path/to/old_file.html /ee/path/to/new_file 302 # To be removed after YYYY-MM-DD
- from: /ee/path/to/old_file.html
to: /ee/path/to/new_file.html
remove_date: YYYY-MM-DD
```
```
The path must start with the internal project directory `/ee` for `gitlab`,
The path must start with the internal project directory `/ee`,
`/gitlab-runner`, `/omnibus-gitlab` or `charts`, and must end with `.html`.
`/runner`, `/omnibus` or `/charts`, and end with either `.html` or `/`
for a clean URL.
`_redirects` entries can be removed after one year.
If the `from:` redirect is an `index.html` file, add a duplicate entry for
the `/` URL (without `index.html). For example:
```yaml
- from: /ee/user/project/operations/index.html
to: /ee/operations/index.html
remove_date: 2021-11-01
- from: /ee/user/project/operations/
to: /ee/operations/index.html
remove_date: 2021-11-01
```
The `remove_date` should be one year after the redirect is submitted.
1. Run the Rake task in the `gitlab-docs` project to populate the `_redirects` file:
```shell
bundle exec rake redirects
```
1. Add both `content/_redirects` and `content/_data/redirects.yaml` to your MR.
1. Search for links to the old file. You must find and update all links to the old file:
1. Search for links to the old file. You must find and update all links to the old file:
- In <https://gitlab.com/gitlab-com/www-gitlab-com>, search for full URLs:
- In <https://gitlab.com/gitlab-com/www-gitlab-com>, search for full URLs:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment