From 7abcc1756e979b885155e87be340ed4d125b689a Mon Sep 17 00:00:00 2001 From: Chad Smith Date: Tue, 7 Feb 2023 08:26:29 -0700 Subject: docs: add themed RTD 404 page and pointer to readthedocs-hosted (#1993) --- doc-requirements.txt | 1 + doc/rtd/conf.py | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) 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 = ( + "

Page not found

Sorry we missed you! Our docs have had a" + " remodel and some deprecated links have changed.

" + "Back to our" + " homepage now hosted at" + " https://canonical-cloud-init.readthedocs-hosted.com

" +) +notfound_context = { + "title": "Page not found", + "body": notfound_body, +} -- cgit v1.2.1