From 53a2484fd1103520dfb347fe2231d210aa37a961 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 20 Jun 2022 14:40:13 -0700 Subject: [PATCH] Warn the user when visiting old documentation This enhances our documentation to look for the file /release_version.json in the root of our site. If found, and if it contains a RELEASE_VERSION other than this version, then unhide a banner warning about the stale documentation and linking to the current. --- doc_src/conf.py | 3 +++ doc_src/python_docs_theme/layout.html | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/doc_src/conf.py b/doc_src/conf.py index 9685885c5..f97790e68 100644 --- a/doc_src/conf.py +++ b/doc_src/conf.py @@ -112,6 +112,9 @@ pygments_style = None html_theme_path = ["."] html_theme = "python_docs_theme" +# Shared styles across all doc versions. +html_css_files = ["/docs/shared/style.css"] + # Don't add a weird "_sources" directory html_copy_source = False diff --git a/doc_src/python_docs_theme/layout.html b/doc_src/python_docs_theme/layout.html index 8cd0b5377..213faa6bc 100644 --- a/doc_src/python_docs_theme/layout.html +++ b/doc_src/python_docs_theme/layout.html @@ -35,6 +35,11 @@ {{ searchbox() }} {%- endif %} + {# This is hidden by default, unhidden by our global shared script. #} + {% endblock %} {# The sidebar goes into the *document* block, so it ends up in the document *div* so it doesn't go over the footer #} @@ -60,6 +65,8 @@ + {% endblock %}