Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 02cdfff

Browse filesBrowse files
ImportanceOfBeingErnestMeeseeksDev[bot]
authored andcommitted
Backport PR #12216: Doc: Fix search for sphinx >=1.8
1 parent 4b3d9e7 commit 02cdfff
Copy full SHA for 02cdfff

File tree

Expand file treeCollapse file tree

1 file changed

+21
-13
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+21
-13
lines changed

‎doc/_templates/layout.html

Copy file name to clipboardExpand all lines: doc/_templates/layout.html
+21-13Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,27 @@ <h3>{{ _('Navigation') }}</h3>
7676
{%- endmacro %}
7777

7878
{%- macro script() %}
79-
<script type="text/javascript">
80-
var DOCUMENTATION_OPTIONS = {
81-
URL_ROOT: '{{ url_root }}',
82-
VERSION: '{{ release|e }}',
83-
COLLAPSE_INDEX: false,
84-
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
85-
HAS_SOURCE: {{ has_source|lower }},
86-
SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}'
87-
};
88-
</script>
89-
{%- for scriptfile in script_files %}
90-
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
91-
{%- endfor %}
79+
{% if sphinx_version >= "1.8.0" %}
80+
<script type="text/javascript" id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
81+
{%- for scriptfile in script_files %}
82+
{{ js_tag(scriptfile) }}
83+
{%- endfor %}
84+
{% else %}
85+
<script type="text/javascript">
86+
var DOCUMENTATION_OPTIONS = {
87+
URL_ROOT:'{{ url_root }}',
88+
VERSION:'{{ release|e }}',
89+
LANGUAGE:'{{ language }}',
90+
COLLAPSE_INDEX:false,
91+
FILE_SUFFIX:'{{ '' if no_search_suffix else file_suffix }}',
92+
HAS_SOURCE: {{ has_source|lower }},
93+
SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}'
94+
};
95+
</script>
96+
{%- for scriptfile in script_files %}
97+
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
98+
{%- endfor %}
99+
{% endif %}
92100
{%- endmacro %}
93101

94102
{%- macro css() %}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.