Skip to content

Commit 0a3e52c

Browse files
hugovkAA-Turner
andauthored
Infra: Add nicer 404 page (#4184)
Co-authored-by: Adam Turner <[email protected]>
1 parent fc00ce6 commit 0a3e52c

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ htmllive: _ensure-sphinx-autobuild html
4040
.PHONY: dirhtml
4141
dirhtml: BUILDER = dirhtml
4242
dirhtml: html
43+
mv $(BUILDDIR)/404/index.html $(BUILDDIR)/404.html
4344

4445
## linkcheck to check validity of links within PEP sources
4546
.PHONY: linkcheck

peps/conf.py

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
# Add any Sphinx extension module names here, as strings.
2121
extensions = [
22+
"notfound.extension",
2223
"pep_sphinx_extensions",
2324
"sphinx.ext.extlinks",
2425
"sphinx.ext.intersphinx",
@@ -85,6 +86,10 @@
8586
"pypi": ("https://pypi.org/project/%s/", "%s"),
8687
}
8788

89+
# sphinx-notfound-page
90+
# https://sphinx-notfound-page.readthedocs.io/en/latest/faq.html#does-this-extension-work-with-github-pages
91+
notfound_urls_prefix = None
92+
8893
# -- Options for HTML output -------------------------------------------------
8994

9095
_PSE_PATH = _ROOT / "pep_sphinx_extensions"

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Pygments >= 2.9.0
44
# See https://github.com/sphinx-doc/sphinx/pull/11100
55
Sphinx >= 5.1.1, != 6.1.0, != 6.1.1, < 8.1.0
66
docutils >= 0.19.0
7+
sphinx-notfound-page >= 1.0.2
78

89
# For tests
910
pytest

0 commit comments

Comments
 (0)