summaryrefslogtreecommitdiff
path: root/Utilities/Sphinx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-04-01 22:12:41 -0400
committerBrad King <brad.king@kitware.com>2022-04-05 16:09:54 -0400
commit5c2e8ce515bc1f47ac6dd6d5b55bfe7f45190a02 (patch)
tree69abe0a6ed823750d0d0214184d22e9f52652ef3 /Utilities/Sphinx
parenta14905d4df6c47dbcd574f05ad0a324906dd1329 (diff)
downloadcmake-5c2e8ce515bc1f47ac6dd6d5b55bfe7f45190a02.tar.gz
Utilities/Sphinx: Add OpenSearch link to html page headers on cmake.org
Reference an OpenSearch description file that sits outside the content of any specific version so we only need to maintain one and so that it can reference the latest version. This was previously added in a custom branch for building the cmake.org reference documentation.
Diffstat (limited to 'Utilities/Sphinx')
-rw-r--r--Utilities/Sphinx/CMakeLists.txt1
-rw-r--r--Utilities/Sphinx/templates/layout.html5
2 files changed, 6 insertions, 0 deletions
diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt
index dd70ce6852..14d0e14f56 100644
--- a/Utilities/Sphinx/CMakeLists.txt
+++ b/Utilities/Sphinx/CMakeLists.txt
@@ -139,6 +139,7 @@ set(doc_html_opts "")
if(CMake_SPHINX_CMAKE_ORG)
list(APPEND doc_html_opts
-A googleanalytics=1
+ -A opensearch=1
-A versionswitch=1
)
diff --git a/Utilities/Sphinx/templates/layout.html b/Utilities/Sphinx/templates/layout.html
index d02b44d9e3..8fb7c42732 100644
--- a/Utilities/Sphinx/templates/layout.html
+++ b/Utilities/Sphinx/templates/layout.html
@@ -31,6 +31,11 @@
{%- endblock %}
{% block extrahead %}
+ {%- if opensearch is defined %}
+ <link rel="search" type="application/opensearchdescription+xml"
+ title="Search within CMake Documentation of Latest Version"
+ href="{{ pathto('../latest-opensearch.xml', 1) }}"/>
+ {%- endif %}
{%- if versionswitch is defined %}
<script type="text/javascript" src="{{ pathto('../version_switch.js', 1) }}"></script>
{%- endif %}