{%- extends "sphinx_rtd_theme/search.html" %}
{% if theme_elasticsearch_host %}
{% set script_files = script_files + ['_static/elasticsearch.jquery.min.js'] %}
{% endif %}
{% block footer %}
{%- if theme_elasticsearch_host %}
{# Cannot use `script_files` for this, since we need to come *after*
`searchtools.js` included by the upstream `search.html` to monkeypatch it.
However, due to `extends`, that runs after us, so instead we take advantage
that block `footer` comes after `script_files` in `layout.html`. #}
{%- endif %}
{{ super() }}
{% endblock %}