Skip to content

Commit

Permalink
Merge branch 'fix_sphinx_rtd_search' into release-cesm2.0
Browse files Browse the repository at this point in the history
This cherry-picks a commit that fixes the search function when using the
sphinx_rtd_theme:

git cherry-pick -X subtree=doc/source/_themes/sphinx_rtd_theme ebbf3d1697c6518a3e398144610b9951bd7ab583

See also readthedocs/sphinx_rtd_theme#672
  • Loading branch information
billsacks committed Dec 10, 2018
2 parents faa3942 + a09b63b commit 03bc8e5
Showing 1 changed file with 22 additions and 14 deletions.
36 changes: 22 additions & 14 deletions doc/source/_themes/sphinx_rtd_theme/sphinx_rtd_theme/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,20 +191,28 @@

{% if not embedded %}

<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 %}
{# 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 #}
{% 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 %}

Expand Down

0 comments on commit 03bc8e5

Please sign in to comment.