Skip to content

Commit 86c726d

Browse files
Render 404 page correctly
1 parent 9e5b838 commit 86c726d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Doc/conf.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,17 @@
572572
stable_abi_file = 'data/stable_abi.dat'
573573
threadsafety_file = 'data/threadsafety.dat'
574574

575+
# Options for notfound.extension
576+
# -------------------------------
577+
578+
if not os.getenv("READTHEDOCS"):
579+
if language_code:
580+
notfound_urls_prefix = (
581+
f'/{language_code.replace("_", "-").lower()}/{version}/'
582+
)
583+
else:
584+
notfound_urls_prefix = f'/{version}/'
585+
575586
# Options for sphinxext-opengraph
576587
# -------------------------------
577588

0 commit comments

Comments
 (0)