summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChad Smith <chad.smith@canonical.com>2023-02-07 08:26:29 -0700
committerGitHub <noreply@github.com>2023-02-07 16:26:29 +0100
commit7abcc1756e979b885155e87be340ed4d125b689a (patch)
treed844a153c79558a7b928532b350d1f9c88de37b1
parentce78c1bf13e41af20e28635a3e2326d5aa4d2469 (diff)
downloadcloud-init-git-7abcc1756e979b885155e87be340ed4d125b689a.tar.gz
docs: add themed RTD 404 page and pointer to readthedocs-hosted (#1993)
-rw-r--r--doc-requirements.txt1
-rw-r--r--doc/rtd/conf.py17
2 files changed, 17 insertions, 1 deletions
diff --git a/doc-requirements.txt b/doc-requirements.txt
index efe93fad..ee2126b0 100644
--- a/doc-requirements.txt
+++ b/doc-requirements.txt
@@ -5,3 +5,4 @@ pyyaml
sphinx
sphinx-design
sphinx-copybutton
+sphinx-notfound-page
diff --git a/doc/rtd/conf.py b/doc/rtd/conf.py
index fe3163f9..6d9a3555 100644
--- a/doc/rtd/conf.py
+++ b/doc/rtd/conf.py
@@ -18,7 +18,7 @@ sys.path.insert(0, os.path.abspath("."))
# General information about the project.
project = "cloud-init"
-copyright = "2022, Canonical Ltd."
+copyright = "Canonical Ltd."
# -- General configuration ----------------------------------------------------
@@ -29,6 +29,7 @@ needs_sphinx = "4.0"
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
"m2r2",
+ "notfound.extension",
"sphinx_copybutton",
"sphinx_design",
"sphinx.ext.autodoc",
@@ -82,3 +83,17 @@ html_theme_options = {
# Make sure the target is unique
autosectionlabel_prefix_document = True
autosectionlabel_maxdepth = 2
+
+# Sphinx-copybutton config options:
+notfound_urls_prefix = "/"
+notfound_body = (
+ "<h1>Page not found</h1><p>Sorry we missed you! Our docs have had a"
+ " remodel and some deprecated links have changed.</p><p>"
+ "<a href='https://canonical-cloud-init.readthedocs-hosted.com'>Back to our"
+ " homepage now hosted at"
+ " https://canonical-cloud-init.readthedocs-hosted.com</a></p>"
+)
+notfound_context = {
+ "title": "Page not found",
+ "body": notfound_body,
+}