feat(docs): friendly 404 page

Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
This commit is contained in:
Josh Richards
2025-09-01 09:02:53 -04:00
parent 4c0dfa1fa2
commit 0ff8729acd
2 changed files with 30 additions and 1 deletions

30
conf.py
View File

@@ -10,7 +10,13 @@ now = datetime.datetime.now()
os.environ["READTHEDOCS"] = "True"
extensions = ['sphinx_rtd_theme', 'sphinx_rtd_dark_mode', 'sphinx_copybutton', 'sphinxcontrib.mermaid']
extensions = [
'sphinx_rtd_theme',
'sphinx_rtd_dark_mode',
'sphinx_copybutton',
'sphinxcontrib.mermaid',
'notfound.extension',
]
# General information about the project.
copyright = str(now.year) + ' Nextcloud GmbH'
@@ -85,3 +91,25 @@ edit_on_github_branch = 'master'
default_dark_mode = False
latex_engine = "xelatex"
# -- Options for sphinx-notfound-page extension -----------------------------------
# https://github.com/readthedocs/sphinx-notfound-page
# content context passed to the 404 template
notfound_context = {
"title": "404 Page Not Found",
"body": """
<h1>Page Not Found</h1>
<h2>Sorry, we can't seem to find the page you're looking for.</h2>
<h6>Error code: 404</h6>
<h3>Here are some alternatives:</h3>
<ol>
<li>Try using the search box.</li>
<li>Check the content menu on the side of this page.</li>
<li>Regroup at our <a href="/">documentation homepage.</a></p></li>
</ol>
""",
}
notfound_urls_prefix = None

View File

@@ -27,6 +27,7 @@ sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-mermaid==1.0.0
sphinx-notfound-page
sphinxcontrib-phpdomain==0.13.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0