diff --git a/docs/docsite/rst/404.rst b/docs/docsite/rst/404.rst new file mode 100644 index 00000000000..ca6dd8959b3 --- /dev/null +++ b/docs/docsite/rst/404.rst @@ -0,0 +1,12 @@ +:orphan: + +***** +Oops! +***** + +This page does not exist in this version of the Ansible documentation. + +.. image:: images/cow.png + :alt: Cowsay 404 + +Return to the :ref:`nearest table of contents in this version ` or use the navigation at left to explore our latest release. diff --git a/docs/docsite/rst/conf.py b/docs/docsite/rst/conf.py index 9e718e4f3a6..2b1e1d06f2a 100644 --- a/docs/docsite/rst/conf.py +++ b/docs/docsite/rst/conf.py @@ -45,7 +45,7 @@ AUTHOR = 'Ansible, Inc' # They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # TEST: 'sphinxcontrib.fulltoc' -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'pygments_lexer'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'pygments_lexer', 'notfound.extension'] # Later on, add 'sphinx.ext.viewcode' to the list if you want to have # colorized code generated too for references. @@ -211,6 +211,19 @@ html_use_opensearch = 'https://docs.ansible.com/ansible/latest' # Output file base name for HTML help builder. htmlhelp_basename = 'Poseidodoc' +# Configuration for sphinx-notfound-pages +# with no 'notfound_template' and no 'notfound_context' set, +# the extension builds 404.rst into a location-agnostic 404 page +# +# default is `en` - using this for the sub-site: +notfound_default_language = "ansible" +# default is `latest`: +# setting explicitly - docsite serves up /ansible/latest/404.html +# so keep this set to `latest` even on the `devel` branch +# then no maintenance is needed when we branch a new stable_x.x +notfound_default_version = "latest" +# makes default setting explicit: +notfound_no_urls_prefix = False # Options for LaTeX output # ------------------------ diff --git a/docs/docsite/rst/images/cow.png b/docs/docsite/rst/images/cow.png new file mode 100644 index 00000000000..9ace4401908 Binary files /dev/null and b/docs/docsite/rst/images/cow.png differ diff --git a/test/runner/requirements/sanity.txt b/test/runner/requirements/sanity.txt index 5d27a4e7abb..cda20ef3c90 100644 --- a/test/runner/requirements/sanity.txt +++ b/test/runner/requirements/sanity.txt @@ -7,6 +7,7 @@ pylint ; python_version >= '3.5' # pylint 2.0.0 and later require python 3+ pytest rstcheck ; python_version >= '2.7' # rstcheck requires python 2.7+ sphinx +sphinx-notfound-page straight.plugin # needed for hacking/build-ansible which will host changelog generation virtualenv voluptuous ; python_version >= '2.7' # voluptuous 0.11.0 and later require python 2.7+