From a14905d4df6c47dbcd574f05ad0a324906dd1329 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 1 Apr 2022 22:09:50 -0400 Subject: Utilities/Sphinx: Add option to build outdated version banner for cmake.org This was previously added in a custom branch for building the cmake.org reference documentation. --- Utilities/Sphinx/CMakeLists.txt | 4 ++++ Utilities/Sphinx/static/cmake.css | 12 ++++++++++++ Utilities/Sphinx/templates/layout.html | 13 +++++++++++++ 3 files changed, 29 insertions(+) (limited to 'Utilities/Sphinx') diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index 65760367ea..dd70ce6852 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -141,6 +141,10 @@ if(CMake_SPHINX_CMAKE_ORG) -A googleanalytics=1 -A versionswitch=1 ) + + if(CMake_SPHINX_CMAKE_ORG_OUTDATED) + list(APPEND doc_html_opts -A outdated=1) + endif() endif() set(doc_format_outputs "") diff --git a/Utilities/Sphinx/static/cmake.css b/Utilities/Sphinx/static/cmake.css index 029eb1b2fc..4539cf96f6 100644 --- a/Utilities/Sphinx/static/cmake.css +++ b/Utilities/Sphinx/static/cmake.css @@ -22,3 +22,15 @@ div.sphinxsidebarwrapper { dd > :first-child > p { margin-top: 0px; } + +div.outdated { + background-color: #f0f0c0; + color: black; + font-size: 90%; + padding-bottom: 5px; + padding-left: 2px; + padding-right: 2px; + padding-top: 5px; + text-align: center; + width: 100%; +} diff --git a/Utilities/Sphinx/templates/layout.html b/Utilities/Sphinx/templates/layout.html index 0cc5c26afe..d02b44d9e3 100644 --- a/Utilities/Sphinx/templates/layout.html +++ b/Utilities/Sphinx/templates/layout.html @@ -17,6 +17,19 @@ {% endblock %} +{%- block relbar1 %} +{{ super() }} +{%- if outdated is defined %} +
+ This documents an old version of CMake. + + Click here to see the latest release. + + +
+{%- endif %} +{%- endblock %} + {% block extrahead %} {%- if versionswitch is defined %} -- cgit v1.2.1