From: Hugo van Kemenade Date: Sat, 2 Dec 2023 17:41:40 +0000 (+0200) Subject: Docs: Use sphinx-notfound-page to show a nicer 404 page (#111084) X-Git-Tag: v3.13.0a3~561 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0229d2a9b1d6ce6daa6a773f92e3754e7dc86d50;p=thirdparty%2FPython%2Fcpython.git Docs: Use sphinx-notfound-page to show a nicer 404 page (#111084) --- diff --git a/Doc/conf.py b/Doc/conf.py index f1b411126c4e..be2a86e12fa2 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -24,7 +24,13 @@ extensions = [ 'sphinx.ext.doctest', ] -# Skip if downstream redistributors haven't installed it +# Skip if downstream redistributors haven't installed them +try: + import notfound.extension +except ImportError: + pass +else: + extensions.append('notfound.extension') try: import sphinxext.opengraph except ImportError: diff --git a/Doc/requirements.txt b/Doc/requirements.txt index ce87be2d3928..04334fd5a464 100644 --- a/Doc/requirements.txt +++ b/Doc/requirements.txt @@ -13,6 +13,7 @@ blurb sphinx-autobuild sphinxext-opengraph==0.7.5 +sphinx-notfound-page==1.0.0 # The theme used by the documentation is stored separately, so we need # to install that as well.