Skip to content

Commit c09ad34

Browse files
committed
Build our docs with a custom 404 page
It uses the external sphinx-notfound-page extension for this.
1 parent 71d5ec1 commit c09ad34

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

docs/conf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@
8181
# Activate autosectionlabel plugin
8282
autosectionlabel_prefix_document = True
8383

84+
# sphinx-notfound-page
85+
# https://github.com/rtfd/sphinx-notfound-page
86+
notfound_context = {
87+
'body': '''
88+
<h1>Page not found</h1>
89+
90+
<p>Sorry, we couldn't find that page.</p>
91+
92+
<p>Try using the search box or go to the homepage.</p>
93+
''',
94+
}
95+
8496

8597
def setup(app):
8698
app.add_stylesheet('css/sphinx_prompt_css.css')

requirements/local-docs-build.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-r pip.txt
22

3-
# Base packages
3+
# Base packages
44
docutils==0.14
55
Sphinx==1.8.3
66
sphinx_rtd_theme==0.4.2
@@ -17,5 +17,6 @@ Markdown==3.0.1
1717
# Docs
1818
sphinxcontrib-httpdomain==1.7.0
1919
sphinx-prompt==1.0.0
20+
sphinx-notfound-page==0.1
2021
commonmark==0.8.1
2122
recommonmark==0.5.0

0 commit comments

Comments
 (0)