Skip to content

Commit a49a812

Browse files
authored
Remove deprecated use of script_files (#728)
* Remove deprecated use of script_files Fixes sphinx-doc/sphinx#6088 * Add script block * Fix build error
1 parent ddfdd35 commit a49a812

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

sphinx_rtd_theme/layout.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
{% endif %}
3030

3131
{# JAVASCRIPTS #}
32+
{%- block scripts %}
3233
<script type="text/javascript" src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script>
3334
{%- if not embedded %}
3435
{# 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 @@
6263
href="{{ pathto('_static/opensearch.xml', 1) }}"/>
6364
{%- endif %}
6465
{%- endif %}
66+
{%- endblock %}
6567

6668
{# CSS #}
6769
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />

sphinx_rtd_theme/search.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
#}
1010
{%- extends "layout.html" %}
1111
{% set title = _('Search') %}
12-
{% set script_files = script_files + ['_static/searchtools.js'] %}
12+
{%- block scripts %}
13+
{{ super() }}
14+
<script type="text/javascript" src="{{ pathto('_static/searchtools.js', 1) }}"></script>
15+
{%- endblock %}
1316
{% block footer %}
1417
<script type="text/javascript">
1518
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });

0 commit comments

Comments
 (0)