|
28 | 28 | <link rel="canonical" href="{{ theme_canonical_url }}{{ pagename }}.html"/> |
29 | 29 | {% endif %} |
30 | 30 |
|
31 | | - {# CSS #} |
32 | | - |
33 | | - {# OPENSEARCH #} |
34 | | - {% if not embedded %} |
35 | | - {% if use_opensearch %} |
36 | | - <link rel="search" type="application/opensearchdescription+xml" |
37 | | - title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" |
38 | | - href="{{ pathto('_static/opensearch.xml', 1) }}"/> |
| 31 | + {# JAVASCRIPTS #} |
| 32 | + <script type="text/javascript" src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script> |
| 33 | + {%- if not embedded %} |
| 34 | + {# 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 #} |
| 35 | + {% if sphinx_version >= "1.8.0" %} |
| 36 | + <script type="text/javascript" id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script> |
| 37 | + {%- for scriptfile in script_files %} |
| 38 | + {{ js_tag(scriptfile) }} |
| 39 | + {%- endfor %} |
| 40 | + {% else %} |
| 41 | + <script type="text/javascript"> |
| 42 | + var DOCUMENTATION_OPTIONS = { |
| 43 | + URL_ROOT:'{{ url_root }}', |
| 44 | + VERSION:'{{ release|e }}', |
| 45 | + LANGUAGE:'{{ language }}', |
| 46 | + COLLAPSE_INDEX:false, |
| 47 | + FILE_SUFFIX:'{{ '' if no_search_suffix else file_suffix }}', |
| 48 | + HAS_SOURCE: {{ has_source|lower }}, |
| 49 | + SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}' |
| 50 | + }; |
| 51 | + </script> |
| 52 | + {%- for scriptfile in script_files %} |
| 53 | + <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> |
| 54 | + {%- endfor %} |
39 | 55 | {% endif %} |
| 56 | + <script type="text/javascript" src="{{ pathto('_static/js/theme.js', 1) }}"></script> |
40 | 57 |
|
41 | | - {% endif %} |
| 58 | + {# OPENSEARCH #} |
| 59 | + {%- if use_opensearch %} |
| 60 | + <link rel="search" type="application/opensearchdescription+xml" |
| 61 | + title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" |
| 62 | + href="{{ pathto('_static/opensearch.xml', 1) }}"/> |
| 63 | + {%- endif %} |
| 64 | + {%- endif %} |
42 | 65 |
|
| 66 | + {# CSS #} |
43 | 67 | <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /> |
44 | 68 | <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" /> |
45 | 69 | {%- for css in css_files %} |
|
49 | 73 | <link rel="stylesheet" href="{{ pathto(css, 1) }}" type="text/css" /> |
50 | 74 | {%- endif %} |
51 | 75 | {%- endfor %} |
| 76 | + |
52 | 77 | {%- for cssfile in extra_css_files %} |
53 | 78 | <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" /> |
54 | 79 | {%- endfor %} |
|
74 | 99 | {%- endif %} |
75 | 100 | {%- endblock %} |
76 | 101 | {%- block extrahead %} {% endblock %} |
77 | | - |
78 | | - {# Keep modernizr in head - http://modernizr.com/docs/#installing #} |
79 | | - <script src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script> |
80 | | - |
81 | 102 | </head> |
82 | 103 |
|
83 | 104 | <body class="wy-body-for-nav"> |
|
186 | 207 | </div> |
187 | 208 | {% include "versions.html" %} |
188 | 209 |
|
189 | | - {% if not embedded %} |
190 | | - |
191 | | - {# 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 #} |
192 | | - {% if sphinx_version >= "1.8.0" %} |
193 | | - <script type="text/javascript" id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script> |
194 | | - {%- for scriptfile in script_files %} |
195 | | - {{ js_tag(scriptfile) }} |
196 | | - {%- endfor %} |
197 | | - {% else %} |
198 | | - <script type="text/javascript"> |
199 | | - var DOCUMENTATION_OPTIONS = { |
200 | | - URL_ROOT:'{{ url_root }}', |
201 | | - VERSION:'{{ release|e }}', |
202 | | - LANGUAGE:'{{ language }}', |
203 | | - COLLAPSE_INDEX:false, |
204 | | - FILE_SUFFIX:'{{ '' if no_search_suffix else file_suffix }}', |
205 | | - HAS_SOURCE: {{ has_source|lower }}, |
206 | | - SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}' |
207 | | - }; |
208 | | - </script> |
209 | | - {%- for scriptfile in script_files %} |
210 | | - <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> |
211 | | - {%- endfor %} |
212 | | - {% endif %} |
213 | | - |
214 | | - {% endif %} |
215 | | - |
216 | | - <script type="text/javascript" src="{{ pathto('_static/js/theme.js', 1) }}"></script> |
217 | | - |
218 | 210 | <script type="text/javascript"> |
219 | 211 | jQuery(function () { |
220 | 212 | SphinxRtdTheme.Navigation.enable({{ 'true' if theme_sticky_navigation|tobool else 'false' }}); |
221 | 213 | }); |
222 | 214 | </script> |
223 | 215 |
|
| 216 | + {# Do not conflict with RTD insertion of analytics script #} |
| 217 | + {% if not READTHEDOCS %} |
| 218 | + {% if theme_analytics_id %} |
| 219 | + <!-- Theme Analytics --> |
| 220 | + <script> |
| 221 | + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
| 222 | + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
| 223 | + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| 224 | + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
| 225 | + |
| 226 | + ga('create', '{{ theme_analytics_id }}', 'auto'); |
| 227 | + ga('send', 'pageview'); |
| 228 | + </script> |
| 229 | + |
| 230 | + {% endif %} |
| 231 | + {% endif %} |
| 232 | + |
224 | 233 | {%- block footer %} {% endblock %} |
225 | 234 |
|
226 | 235 | </body> |
|
0 commit comments