Skip to content

Commit 752d77c

Browse files
[doc] Redirect the redirected link for single file
1 parent 7354ca0 commit 752d77c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

doc/conf.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,32 @@
4747

4848

4949
# Single file redirects are handled in this file and can be done by a pylint
50-
# contributor if no englobing full directory redirect is applied first. See:
50+
# contributor See:
5151
# https://documatt.gitlab.io/sphinx-reredirects/usage.html
5252
# Directory redirects are handled in ReadTheDoc admin interface and can only be done
5353
# by pylint maintainers at the following URL:
5454
# https://readthedocs.org/dashboard/pylint/redirects/
5555
DIRECTORY_REDIRECT = [
5656
# This list has no effect it must be manually updated from the Read the doc conf
5757
"messages/",
58+
# If an englobing full directory redirect is applied first then it's impossible to
59+
# redirect a single link directly. For this you'll need to redirect the redirected link.
60+
# I.e. 'messages/old => messages/another_dir/new.html' is impossible.
61+
# But you can do 'messages/another_dir/old => messages/another_dir/new.html'
5862
]
5963
redirects: dict[str, str] = {
6064
# "<source>": "<target>"
6165
"intro": "index.html",
6266
"support": "contact.html",
6367
"user_guide/ide-integration": "installation.html",
6468
"user_guide/message-control": "user_guide/messages/message_control.html",
69+
"user_guide/messages/messages_introduction": "user_guide/messages/index.html",
70+
"user_guide/messages/messages_list": "user_guide/messages/messages_overview.html",
6571
}
6672
for m in redirects:
6773
for r in DIRECTORY_REDIRECT:
6874
assert not m.startswith(r), (
69-
f"Redirection will silentely fail: '{m}' start with '{r}' and "
75+
f"Redirection will silently fail: '{m}' start with '{r}' and "
7076
"the whole directory is redirected by ReadtheDoc conf already."
7177
)
7278

0 commit comments

Comments
 (0)