diff --git a/conf.py b/conf.py index 08b572e8b..a649d8cf2 100644 --- a/conf.py +++ b/conf.py @@ -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": """ +

Page Not Found

+

Sorry, we can't seem to find the page you're looking for.

+
Error code: 404
+ +

Here are some alternatives:

+
    +
  1. Try using the search box.
  2. +
  3. Check the content menu on the side of this page.
  4. +
  5. Regroup at our documentation homepage.

  6. +
+""", +} + +notfound_urls_prefix = None diff --git a/requirements.txt b/requirements.txt index 57fd118b6..f3580d4f2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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