Fix #8419: html search: Do not load language_data.js in non-search pages

The ``language_data.js`` is only used on search page.  But it is always
loaded meaninglessly.  This fixes not to load it on all non-search pages.
This commit is contained in:
Takeshi KOMIYA 2020-11-19 02:12:39 +09:00
parent 68c91b1920
commit d0389dce07
3 changed files with 2 additions and 1 deletions

View File

@ -42,6 +42,7 @@ Bugs fixed
is decorated
* #8434: autodoc: :confval:`autodoc_type_aliases` does not effect to variables
and attributes
* #8419: html search: Do not load ``language_data.js`` in non-search pages
Testing
--------

View File

@ -301,7 +301,6 @@ class StandaloneHTMLBuilder(Builder):
self.add_js_file('jquery.js')
self.add_js_file('underscore.js')
self.add_js_file('doctools.js')
self.add_js_file('language_data.js')
for filename, attrs in self.app.registry.js_files:
self.add_js_file(filename, **attrs)

View File

@ -12,6 +12,7 @@
{%- block scripts %}
{{ super() }}
<script src="{{ pathto('_static/searchtools.js', 1) }}"></script>
<script src="{{ pathto('_static/language_data.js', 1) }}"></script>
{%- endblock %}
{% block extrahead %}
<script src="{{ pathto('searchindex.js', 1) }}" defer></script>