diff options
author | Brad King <brad.king@kitware.com> | 2022-04-02 02:09:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-04-05 20:09:54 (GMT) |
commit | a14905d4df6c47dbcd574f05ad0a324906dd1329 (patch) | |
tree | c5c6dffcebdf9dd3f3bb56fccaf7d4226decb4b4 /Utilities | |
parent | cca73b54ae6a25f50b17cf32077ca85020340d92 (diff) | |
download | CMake-a14905d4df6c47dbcd574f05ad0a324906dd1329.zip CMake-a14905d4df6c47dbcd574f05ad0a324906dd1329.tar.gz CMake-a14905d4df6c47dbcd574f05ad0a324906dd1329.tar.bz2 |
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.
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/Sphinx/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Utilities/Sphinx/static/cmake.css | 12 | ||||
-rw-r--r-- | Utilities/Sphinx/templates/layout.html | 13 |
3 files changed, 29 insertions, 0 deletions
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index 6576036..dd70ce6 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 029eb1b..4539cf9 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 0cc5c26..d02b44d 100644 --- a/Utilities/Sphinx/templates/layout.html +++ b/Utilities/Sphinx/templates/layout.html @@ -17,6 +17,19 @@ </li> {% endblock %} +{%- block relbar1 %} +{{ super() }} +{%- if outdated is defined %} + <div class="outdated"> + This documents an old version of CMake. + <a href="https://cmake.org/cmake/help/latest/{{ pagename }}.html"> + Click here to see the latest release. + </a> + <span class="version_switch_note"></span> + </div> +{%- endif %} +{%- endblock %} + {% block extrahead %} {%- if versionswitch is defined %} <script type="text/javascript" src="{{ pathto('../version_switch.js', 1) }}"></script> |