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.
This commit is contained in:
Brad King
2022-04-01 22:12:41 -04:00
parent a14905d4df
commit 5c2e8ce515
2 changed files with 6 additions and 0 deletions

View File

@@ -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
)

View File

@@ -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 %}