From 38f67f4269a762cdc4147e9ad7dde48f3de81f40 Mon Sep 17 00:00:00 2001
From: patrick96
Date: Sun, 22 Oct 2023 22:17:10 +0200
Subject: [PATCH] doc: Add sphinx 404 page
---
doc/conf.py | 10 +++++++---
doc/requirements.txt | 1 +
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/doc/conf.py b/doc/conf.py
index a82c0e03..7beafddc 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -88,10 +88,14 @@ extensions = [
"sphinx.ext.extlinks",
]
-# The search extension works only on readthedocs
-# See https://readthedocs-sphinx-search.readthedocs.io
if on_rtd:
- extensions.append("sphinx_search.extension")
+ extensions += [
+ # The custom 404 page is only needed
+ "notfound.extension",
+ # The search extension works only on readthedocs
+ # See https://readthedocs-sphinx-search.readthedocs.io
+ "sphinx_search.extension",
+ ]
# Add any paths that contain templates here, relative to this directory.
templates_path = [doc_path + '/_templates']
diff --git a/doc/requirements.txt b/doc/requirements.txt
index f31b40c3..bf95a390 100644
--- a/doc/requirements.txt
+++ b/doc/requirements.txt
@@ -1,2 +1,3 @@
sphinx-rtd-theme~=1.3.0
+sphinx-notfound-page~=1.0.0
readthedocs-sphinx-search~=0.3.1