|
6 | 6 | {%- else %} |
7 | 7 | {%- set titlesuffix = "" %} |
8 | 8 | {%- endif %} |
| 9 | +{%- set lang_attr = 'en' if language == None else (language | replace('_', '-')) %} |
9 | 10 |
|
10 | 11 | <!DOCTYPE html> |
11 | | -<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> |
12 | | -<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> |
| 12 | +<!--[if IE 8]><html class="no-js lt-ie9" lang="{{ lang_attr }}" > <![endif]--> |
| 13 | +<!--[if gt IE 8]><!--> <html class="no-js" lang="{{ lang_attr }}" > <!--<![endif]--> |
13 | 14 | <head> |
14 | 15 | <meta charset="utf-8"> |
15 | 16 | {{ metatags }} |
|
27 | 28 | <link rel="canonical" href="{{ theme_canonical_url }}{{ pagename }}.html"/> |
28 | 29 | {% endif %} |
29 | 30 |
|
30 | | - {# CSS #} |
31 | | - |
32 | | - {# OPENSEARCH #} |
33 | | - {% if not embedded %} |
34 | | - {% if use_opensearch %} |
35 | | - <link rel="search" type="application/opensearchdescription+xml" title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" 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 %} |
36 | 55 | {% endif %} |
| 56 | + <script type="text/javascript" src="{{ pathto('_static/js/theme.js', 1) }}"></script> |
37 | 57 |
|
38 | | - {% endif %} |
39 | | - |
40 | | - {# RTD hosts this file, so just load on non RTD builds #} |
41 | | - {% if not READTHEDOCS %} |
42 | | - <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /> |
43 | | - {% 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 %} |
44 | 65 |
|
45 | | - {% for cssfile in css_files %} |
46 | | - <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" /> |
47 | | - {% endfor %} |
| 66 | + {# CSS #} |
| 67 | + <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /> |
| 68 | + <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" /> |
| 69 | + {%- for css in css_files %} |
| 70 | + {%- if css|attr("rel") %} |
| 71 | + <link rel="{{ css.rel }}" href="{{ pathto(css.filename, 1) }}" type="text/css"{% if css.title is not none %} title="{{ css.title }}"{% endif %} /> |
| 72 | + {%- else %} |
| 73 | + <link rel="stylesheet" href="{{ pathto(css, 1) }}" type="text/css" /> |
| 74 | + {%- endif %} |
| 75 | + {%- endfor %} |
48 | 76 |
|
49 | | - {% for cssfile in extra_css_files %} |
| 77 | + {%- for cssfile in extra_css_files %} |
50 | 78 | <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" /> |
51 | | - {% endfor %} |
| 79 | + {%- endfor %} |
52 | 80 |
|
53 | 81 | {%- block linktags %} |
54 | 82 | {%- if hasdoc('about') %} |
55 | | - <link rel="author" title="{{ _('About these documents') }}" |
56 | | - href="{{ pathto('about') }}"/> |
| 83 | + <link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" /> |
57 | 84 | {%- endif %} |
58 | 85 | {%- if hasdoc('genindex') %} |
59 | | - <link rel="index" title="{{ _('Index') }}" |
60 | | - href="{{ pathto('genindex') }}"/> |
| 86 | + <link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" /> |
61 | 87 | {%- endif %} |
62 | 88 | {%- if hasdoc('search') %} |
63 | | - <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}"/> |
| 89 | + <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" /> |
64 | 90 | {%- endif %} |
65 | 91 | {%- if hasdoc('copyright') %} |
66 | | - <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}"/> |
67 | | - {%- endif %} |
68 | | - <link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}"/> |
69 | | - {%- if parents %} |
70 | | - <link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}"/> |
| 92 | + <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" /> |
71 | 93 | {%- endif %} |
72 | 94 | {%- if next %} |
73 | | - <link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}"/> |
| 95 | + <link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" /> |
74 | 96 | {%- endif %} |
75 | 97 | {%- if prev %} |
76 | | - <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}"/> |
| 98 | + <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" /> |
77 | 99 | {%- endif %} |
78 | 100 | {%- endblock %} |
79 | 101 | {%- block extrahead %} {% endblock %} |
80 | | - |
81 | | - {# Keep modernizr in head - http://modernizr.com/docs/#installing #} |
82 | | - <script src="{{ pathto('_static/js/modernizr.min.js', 1) }}"></script> |
83 | | - |
84 | 102 | </head> |
85 | 103 |
|
86 | | -<body class="wy-body-for-nav" role="document"> |
| 104 | +<body class="wy-body-for-nav"> |
87 | 105 |
|
88 | 106 | {% block extrabody %} {% endblock %} |
89 | 107 | <div class="wy-grid-for-nav"> |
90 | | - |
91 | 108 | {# SIDE NAV, TOGGLES ON MOBILE #} |
92 | 109 | <nav data-toggle="wy-nav-shift" class="wy-nav-side"> |
93 | 110 | <div class="wy-side-scroll"> |
94 | | - <div class="wy-side-nav-search"> |
| 111 | + <div class="wy-side-nav-search" {% if theme_style_nav_header_background %} style="background: {{theme_style_nav_header_background}}" {% endif %}> |
95 | 112 | {% block sidebartitle %} |
96 | 113 |
|
97 | 114 | {% if logo and theme_logo_only %} |
|
101 | 118 | {% endif %} |
102 | 119 |
|
103 | 120 | {% if logo %} |
104 | | - {# Not strictly valid HTML, but it's the only way to display/scale it properly, without weird scripting or heaps of work #} |
105 | | - <img src="{{ pathto('_static/' + logo, 1) }}" class="logo" /> |
| 121 | + {# Not strictly valid HTML, but it's the only way to display/scale |
| 122 | + it properly, without weird scripting or heaps of work |
| 123 | + #} |
| 124 | + <img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="Logo"/> |
106 | 125 | {% endif %} |
107 | 126 | </a> |
108 | 127 |
|
|
130 | 149 | toctree is empty. Skip building this for now. |
131 | 150 | #} |
132 | 151 | {% if 'singlehtml' not in builder %} |
133 | | - {% set global_toc = toctree(maxdepth=theme_navigation_depth|int, collapse=theme_collapse_navigation, includehidden=True) %} |
| 152 | + {% set global_toc = toctree(maxdepth=theme_navigation_depth|int, |
| 153 | + collapse=theme_collapse_navigation|tobool, |
| 154 | + includehidden=theme_includehidden|tobool, |
| 155 | + titles_only=theme_titles_only|tobool) %} |
134 | 156 | {% endif %} |
135 | 157 | {% if global_toc %} |
136 | 158 | {{ global_toc }} |
|
146 | 168 | <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> |
147 | 169 |
|
148 | 170 | {# MOBILE NAV, TRIGGLES SIDE NAV ON TOGGLE #} |
149 | | - <nav class="wy-nav-top" role="navigation" aria-label="top navigation"> |
| 171 | + <nav class="wy-nav-top" aria-label="top navigation"> |
150 | 172 | {% block mobile_nav %} |
151 | 173 | <i data-toggle="wy-nav-top" class="fa fa-bars"></i> |
152 | 174 | <a href="{{ pathto(master_doc) }}">{{ project }}</a> |
153 | 175 | {% endblock %} |
154 | 176 | </nav> |
155 | 177 |
|
156 | 178 |
|
157 | | - {# PAGE CONTENT #} |
158 | 179 | <div class="wy-nav-content"> |
| 180 | + {%- block content %} |
| 181 | + {% if theme_style_external_links|tobool %} |
| 182 | + <div class="rst-content style-external-links"> |
| 183 | + {% else %} |
159 | 184 | <div class="rst-content"> |
| 185 | + {% endif %} |
160 | 186 | {% include "breadcrumbs.html" %} |
161 | 187 | <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> |
| 188 | + {%- block document %} |
162 | 189 | <div itemprop="articleBody"> |
163 | 190 | {% block body %}{% endblock %} |
164 | 191 | </div> |
| 192 | + {% if self.comments()|trim %} |
165 | 193 | <div class="articleComments"> |
166 | 194 | {% block comments %}{% endblock %} |
167 | 195 | </div> |
| 196 | + {% endif%} |
168 | 197 | </div> |
| 198 | + {%- endblock %} |
169 | 199 | {% include "footer.html" %} |
170 | 200 | </div> |
| 201 | + {%- endblock %} |
171 | 202 | </div> |
172 | 203 |
|
173 | 204 | </section> |
174 | 205 |
|
175 | 206 | </div> |
176 | 207 | {% include "versions.html" %} |
177 | 208 |
|
178 | | - {% if not embedded %} |
179 | | - |
180 | | - <script type="text/javascript"> |
181 | | - var DOCUMENTATION_OPTIONS = { |
182 | | - URL_ROOT:'{{ url_root }}', |
183 | | - VERSION:'{{ release|e }}', |
184 | | - COLLAPSE_INDEX:false, |
185 | | - FILE_SUFFIX:'{{ '' if no_search_suffix else file_suffix }}', |
186 | | - HAS_SOURCE: {{ has_source|lower }}, |
187 | | - SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}' |
188 | | - }; |
189 | | - </script> |
190 | | - {%- for scriptfile in script_files %} |
191 | | - <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> |
192 | | - {%- endfor %} |
193 | | - |
194 | | - {% endif %} |
195 | | - |
196 | | - {# RTD hosts this file, so just load on non RTD builds #} |
197 | | - {% if not READTHEDOCS %} |
198 | | - <script type="text/javascript" src="{{ pathto('_static/js/theme.js', 1) }}"></script> |
199 | | - {% endif %} |
200 | | - |
201 | | - {# STICKY NAVIGATION #} |
202 | | - {% if theme_sticky_navigation %} |
203 | 209 | <script type="text/javascript"> |
204 | 210 | jQuery(function () { |
205 | | - SphinxRtdTheme.StickyNav.enable(); |
| 211 | + SphinxRtdTheme.Navigation.enable({{ 'true' if theme_sticky_navigation|tobool else 'false' }}); |
206 | 212 | }); |
207 | 213 | </script> |
| 214 | + |
| 215 | + {# Do not conflict with RTD insertion of analytics script #} |
| 216 | + {% if not READTHEDOCS %} |
| 217 | + {% if theme_analytics_id %} |
| 218 | + <!-- Theme Analytics --> |
| 219 | + <script> |
| 220 | + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ |
| 221 | + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), |
| 222 | + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) |
| 223 | + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); |
| 224 | + |
| 225 | + ga('create', '{{ theme_analytics_id }}', 'auto'); |
| 226 | + ga('send', 'pageview'); |
| 227 | + </script> |
| 228 | + |
| 229 | + {% endif %} |
208 | 230 | {% endif %} |
209 | 231 |
|
210 | 232 | {%- block footer %} {% endblock %} |
|
0 commit comments