|
57 | 57 | {%- if not embedded %} |
58 | 58 | {# 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 #} |
59 | 59 | {%- if sphinx_version >= "1.8.0" -%} |
60 | | - <script type="text/javascript" id="documentation_options" data-url_root="{{ url_root }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script> |
| 60 | + <script id="documentation_options" data-url_root="{{ url_root }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script> |
61 | 61 | {%- for scriptfile in script_files %} |
62 | 62 | {{ js_tag(scriptfile) }} |
63 | 63 | {%- endfor %} |
64 | 64 | {%- else %} |
65 | | - <script type="text/javascript"> |
| 65 | + <script> |
66 | 66 | var DOCUMENTATION_OPTIONS = { |
67 | 67 | URL_ROOT:'{{ url_root }}', |
68 | 68 | VERSION:'{{ release|e }}', |
|
74 | 74 | }; |
75 | 75 | </script> |
76 | 76 | {%- for scriptfile in script_files %} |
77 | | - <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> |
| 77 | + <script src="{{ pathto(scriptfile, 1) }}"></script> |
78 | 78 | {%- endfor %} |
79 | 79 | {%- endif %} |
80 | | - <script type="text/javascript" src="{{ pathto('_static/js/theme.js', 1) }}"></script> |
| 80 | + <script src="{{ pathto('_static/js/theme.js', 1) }}"></script> |
81 | 81 |
|
82 | 82 | {#- OPENSEARCH #} |
83 | 83 | {%- if use_opensearch %} |
|
174 | 174 | <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> |
175 | 175 |
|
176 | 176 | {#- MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #} |
177 | | - <nav class="wy-nav-top" aria-label="{{ _('Top') }}"> |
| 177 | + <nav class="wy-nav-top" aria-label="{{ _('Top') }}" {% if theme_style_nav_header_background %} style="background: {{theme_style_nav_header_background}}" {% endif %}> |
178 | 178 | {%- block mobile_nav %} |
179 | 179 | <i data-toggle="wy-nav-top" class="fa fa-bars"></i> |
180 | 180 | <a href="{{ pathto(master_doc) }}">{{ project }}</a> |
|
209 | 209 | </div> |
210 | 210 | {% include "versions.html" -%} |
211 | 211 |
|
212 | | - <script type="text/javascript"> |
| 212 | + <script> |
213 | 213 | jQuery(function () { |
214 | 214 | SphinxRtdTheme.Navigation.enable({{ 'true' if theme_sticky_navigation|tobool else 'false' }}); |
215 | 215 | }); |
|
219 | 219 | {%- if not READTHEDOCS %} |
220 | 220 | {%- if theme_analytics_id %} |
221 | 221 | <!-- Theme Analytics --> |
| 222 | + <script async src="https://www.googletagmanager.com/gtag/js?id={{ theme_analytics_id }}"></script> |
222 | 223 | <script> |
223 | | - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
224 | | - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
225 | | - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
226 | | - })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
227 | | - |
228 | | - ga('create', '{{ theme_analytics_id }}', 'auto'); |
229 | | - {%- if theme_analytics_anonymize_ip|tobool %} |
230 | | - ga('set', 'anonymizeIp', true); |
231 | | - {%- endif %} |
232 | | - ga('send', 'pageview'); |
| 224 | + window.dataLayer = window.dataLayer || []; |
| 225 | + function gtag(){dataLayer.push(arguments);} |
| 226 | + gtag('js', new Date()); |
| 227 | + |
| 228 | + gtag('config', '{{ theme_analytics_id }}', { |
| 229 | + 'anonymize_ip': {{ 'true' if theme_analytics_anonymize_ip|tobool else 'false' }}, |
| 230 | + }); |
233 | 231 | </script> |
234 | 232 |
|
235 | 233 | {%- endif %} |
|
0 commit comments