Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
Fix scripts for search.
Browse files Browse the repository at this point in the history
ref: #16
  • Loading branch information
lepture committed Jan 29, 2019
1 parent 2bbd397 commit 7871fda
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
2 changes: 2 additions & 0 deletions sphinx_typlog_theme/layout.html
Expand Up @@ -62,7 +62,9 @@
{%- endif %}
{%- endblock %}
<script>{% include "js/ga.js" %}</script>
{%- block scripts %}
{%- include "scripts.html" %}
{%- endblock %}
{%- if theme_meta_html %}{{ theme_meta_html }}{% endif %}
{%- block extrahead %}{% endblock %}
</head>
Expand Down
41 changes: 25 additions & 16 deletions sphinx_typlog_theme/scripts.html
@@ -1,16 +1,25 @@
{% 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 %}
{% endif %}
{%- if not embedded %}

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

0 comments on commit 7871fda

Please sign in to comment.