mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-20 14:10:27 -06:00
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.
This commit is contained in:
@@ -492,4 +492,5 @@
|
||||
- cd build/
|
||||
- cmake ../Utilities/Sphinx -GNinja -DSPHINX_HTML=ON
|
||||
-DCMake_SPHINX_CMAKE_ORG=ON
|
||||
-DCMake_SPHINX_CMAKE_ORG_OUTDATED=$CMAKE_CI_SPHINX_OUTDATED
|
||||
- ninja
|
||||
|
||||
@@ -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 "")
|
||||
|
||||
@@ -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%;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user