summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevi Sandeep Endluri <sandeep0138@gmail.com>2020-06-18 03:25:57 -0500
committerDevi Sandeep Endluri <sandeep0138@gmail.com>2020-06-18 03:31:58 -0500
commit08d1673dff2884866462c98d2f002c221bedd06b (patch)
tree0bb04a87e1471c153ed1eb6cef7a3cbbbf450b8c
parentb15a88114aa9def3acdac3ab40a9137f3e5bb44d (diff)
downloadscipy-sphinx-theme-08d1673dff2884866462c98d2f002c221bedd06b.tar.gz
Fix search issue in scipy devdocs.
In https://scipy.github.io/devdocs, when you use the search box, the links it returns include an "undefined" that make them invalid. Example: first link of https://scipy.github.io/devdocs/search.html?q=eigh is https://scipy.github.io/devdocs/generated/scipy.linalg.eighundefined ?highlight=eigh. This is because the LINK_SUFFIX is not assigned any value. The fix is to include the generated documentation_options.js file, so that irrespective of the Sphinx version, the appropriate attributes would be set.
-rw-r--r--_theme/scipy/layout.html10
1 files changed, 1 insertions, 9 deletions
diff --git a/_theme/scipy/layout.html b/_theme/scipy/layout.html
index 6bf7027..5b32f94 100644
--- a/_theme/scipy/layout.html
+++ b/_theme/scipy/layout.html
@@ -87,15 +87,7 @@
{%- endmacro %}
{%- macro script() %}
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '{{ url_root }}',
- VERSION: '{{ release|e }}',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
- HAS_SOURCE: {{ has_source|lower }}
- };
- </script>
+ <script type="text/javascript" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
{%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{%- endfor %}