From 1caccbcb0ea09b221d70096ba6043b3fea4ce669 Mon Sep 17 00:00:00 2001 From: Peyton Murray Date: Sun, 22 Oct 2023 14:35:13 -0700 Subject: [PATCH] Add 404 page (#48) * Add 404 page * An attempt avoid build warning/error by setting `notfound_urls_prefix` to an empty string instead of None --------- Co-authored-by: Maniacal Chicken --- requirements.txt | 1 + src/404.md | 10 ++++++++++ src/conf.py | 3 +++ 3 files changed, 14 insertions(+) create mode 100644 src/404.md diff --git a/requirements.txt b/requirements.txt index 382f5a5..edd788c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ pre-commit pydata-sphinx-theme sphinx>=7 sphinx-design +sphinx-notfound-page diff --git a/src/404.md b/src/404.md new file mode 100644 index 0000000..d1c9cf3 --- /dev/null +++ b/src/404.md @@ -0,0 +1,10 @@ +--- +orphan: true +permalink: /404.html +--- + +# Page not found + +**Sorry, this page couldn't be found.** + +Click on the navigation bar at the top of the page to go elsewhere. diff --git a/src/conf.py b/src/conf.py index e2127cb..546f10d 100644 --- a/src/conf.py +++ b/src/conf.py @@ -25,6 +25,7 @@ extensions = [ "myst_parser", "sphinx_design", + "notfound.extension", ] myst_enable_extensions = [ @@ -67,6 +68,8 @@ html_static_path = ["_static"] +notfound_urls_prefix = '' + def setup(app): # Styles applied to the entire wiki