Remove deprecated use of script_files (#728)

* Remove deprecated use of script_files

Fixes https://github.com/sphinx-doc/sphinx/issues/6088

* Add script block

* Fix build error
This commit is contained in:
Aaron Carlisle 2019-04-03 10:42:19 -04:00 committed by GitHub
parent ddfdd35e69
commit a49a812c88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -29,6 +29,7 @@
{% endif %}
{# JAVASCRIPTS #}
{%- block scripts %}
<script type="text/javascript" src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script>
{%- if not embedded %}
{# XXX Sphinx 1.8.0 made this an external js-file, quick fix until we refactor the template to inherert more blocks directly from sphinx #}
@ -62,6 +63,7 @@
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
{%- endif %}
{%- endif %}
{%- endblock %}
{# CSS #}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />

View File

@ -9,7 +9,10 @@
#}
{%- extends "layout.html" %}
{% set title = _('Search') %}
{% set script_files = script_files + ['_static/searchtools.js'] %}
{%- block scripts %}
{{ super() }}
<script type="text/javascript" src="{{ pathto('_static/searchtools.js', 1) }}"></script>
{%- endblock %}
{% block footer %}
<script type="text/javascript">
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });