diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2018-10-23 13:08:59 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2018-10-23 13:08:59 -0400 |
| commit | 62b6262a8c7a425269d93de77a0e366fd9751316 (patch) | |
| tree | bd69ffc95af8edb84627ef2378797f5b09d5d7cd | |
| parent | a4a5291ff2a7ca343695fc3144a2aafd936b3b45 (diff) | |
fix offline search
| -rw-r--r-- | sphinx_rtd_theme/layout.html | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/sphinx_rtd_theme/layout.html b/sphinx_rtd_theme/layout.html index 52ca7500..fe669206 100644 --- a/sphinx_rtd_theme/layout.html +++ b/sphinx_rtd_theme/layout.html @@ -164,7 +164,7 @@ {% if not embedded %} - <script type="text/javascript"> +<!-- <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT:'{{ url_root }}', VERSION:'{{ release|e }}', @@ -173,9 +173,29 @@ HAS_SOURCE: {{ has_source|lower }} }; </script> - {%- for scriptfile in script_files %} - <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> - {%- endfor %} +--> + {% if sphinx_version >= "1.8.0" %} + <script type="text/javascript" id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script> + {%- for scriptfile in script_files %} + {{ js_tag(scriptfile) }} + {%- endfor %} + {% else %} + <script type="text/javascript"> + var DOCUMENTATION_OPTIONS = { + URL_ROOT:'{{ url_root }}', + VERSION:'{{ release|e }}', + LANGUAGE:'{{ language }}', + COLLAPSE_INDEX:false, + FILE_SUFFIX:'{{ '' if no_search_suffix else file_suffix }}', + HAS_SOURCE: {{ has_source|lower }}, + SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}' + }; + </script> + {%- for scriptfile in script_files %} + <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> + {%- endfor %} + {% endif %} + {% endif %} |
