Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4bed3f6

Browse files
committed
Fix searchindex.js loading by porting sphinx-doc/sphinx#6091
Hopefully a more future-proof fix, removing the dependency on ajax and searchtools.js altogether. (After loading, searchindex.js itself does depend on searchtools.js, but both are updated with the version of sphinx that is used, unlike this template.) Because the script is loaded with `defer` and also right at the end of the body, the size of searchindex.js should not block loading the rest of the page (one of the arguments for using ajax).
1 parent adbc7b1 commit 4bed3f6

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

doc/_templates/search.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,5 @@ <h2>{{ _('Search Results') }}</h2>
4141
{% endblock %}
4242
{% block footer %}
4343
{{ super() }}
44-
<script type="text/javascript">
45-
jQuery(function() { Search.loadIndex("searchindex.js"); });
46-
</script>
47-
<script type="text/javascript" id="searchindexloader"></script>
44+
<script type="text/javascript" src="{{ pathto('searchindex.js', 1) }}" defer></script>
4845
{% endblock %}

0 commit comments

Comments
 (0)