From 3aa24f7989cf5b47f854afaff3bb170dec6dcf14 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 19 Oct 2023 18:52:42 +0300 Subject: [PATCH] Docs: Use sphinx-notfound-page to show a nicer 404 page --- Doc/conf.py | 8 +++++++- Doc/requirements.txt | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Doc/conf.py b/Doc/conf.py index c92ea60ee07094..d2a9ae74a5b0a2 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -24,7 +24,13 @@ '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 d4f23ea8c400fe..e7a64a735c501e 100644 --- a/Doc/requirements.txt +++ b/Doc/requirements.txt @@ -12,6 +12,7 @@ sphinx==6.2.1 blurb 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.