From 0229d2a9b1d6ce6daa6a773f92e3754e7dc86d50 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Sat, 2 Dec 2023 19:41:40 +0200 Subject: [PATCH] Docs: Use sphinx-notfound-page to show a nicer 404 page (#111084) --- 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 f1b411126c4e87..be2a86e12fa2e4 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 ce87be2d392824..04334fd5a464d4 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.