From 86c726deef5c2695561f0e59deaabb9627fb3998 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Wed, 1 Apr 2026 21:08:58 +0200 Subject: [PATCH] Render 404 page correctly --- Doc/conf.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Doc/conf.py b/Doc/conf.py index 07e0d113a24c10..f021c9eabe4dda 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -572,6 +572,17 @@ stable_abi_file = 'data/stable_abi.dat' threadsafety_file = 'data/threadsafety.dat' +# Options for notfound.extension +# ------------------------------- + +if not os.getenv("READTHEDOCS"): + if language_code: + notfound_urls_prefix = ( + f'/{language_code.replace("_", "-").lower()}/{version}/' + ) + else: + notfound_urls_prefix = f'/{version}/' + # Options for sphinxext-opengraph # -------------------------------