Skip to content

Commit 1a188aa

Browse files
[3.13] gh-125895: Fix static asset location for sphinx-notfound-page (GH-147984) (#148041)
(cherry picked from commit 80ab6d9) Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 2a00d94 commit 1a188aa

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
@@ -561,6 +561,17 @@
561561
refcount_file = 'data/refcounts.dat'
562562
stable_abi_file = 'data/stable_abi.dat'
563563

564+
# Options for notfound.extension
565+
# -------------------------------
566+
567+
if not os.getenv("READTHEDOCS"):
568+
if language_code:
569+
notfound_urls_prefix = (
570+
f'/{language_code.replace("_", "-").lower()}/{version}/'
571+
)
572+
else:
573+
notfound_urls_prefix = f'/{version}/'
574+
564575
# Options for sphinxext-opengraph
565576
# -------------------------------
566577

0 commit comments

Comments
 (0)