1- {#
2- basic/layout.html
3- ~~~~~~~~~~~~~~~~~
4-
5- Master layout template for Sphinx themes.
6-
7- :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
8- :license: BSD, see LICENSE for details.
9- #}
10- {%- block doctype -%}{%- if html5_doctype %}
1+ {# Master layout template for Sphinx themes. #}
2+ {%- block doctype -%}
113<!DOCTYPE html>
12- {%- else %}
13- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
14- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
15- {%- endif %}{%- endblock %}
4+ {%- endblock %}
165{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %}
176{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %}
187{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and
198 (sidebars != []) %}
20- {%- set url_root = pathto('', 1) %}
21- {# XXX necessary? #}
22- {%- if url_root == '#' %}{% set url_root = '' %}{% endif %}
9+ {# URL root should never be #, then all links are fragments #}
2310{%- if not embedded and docstitle %}
2411 {%- set titlesuffix = " — "|safe + docstitle|e %}
2512{%- else %}
2613 {%- set titlesuffix = "" %}
2714{%- endif %}
2815
2916{%- macro relbar() %}
30- < div class ="related " role ="navigation " aria-label ="related navigation ">
17+ < div class ="related " role ="navigation " aria-label ="Related ">
3118 < h3 > {{ _('Navigation') }}</ h3 >
3219 < ul >
3320 {%- for rellink in rellinks %}
@@ -37,7 +24,7 @@ <h3>{{ _('Navigation') }}</h3>
3724 {%- if not loop.first %}{{ reldelim2 }}{% endif %}</ li >
3825 {%- endfor %}
3926 {%- block rootrellink %}
40- < li class ="nav-item nav-item-0 "> < a href ="{{ pathto(master_doc )|e }} "> {{ shorttitle|e }}</ a > {{ reldelim1 }}</ li >
27+ < li class ="nav-item nav-item-0 "> < a href ="{{ pathto(root_doc )|e }} "> {{ shorttitle|e }}</ a > {{ reldelim1 }}</ li >
4128 {%- endblock %}
4229 {%- for parent in parents %}
4330 < li class ="nav-item nav-item-{{ loop.index }} "> < a href ="{{ parent.link|e }} " {% if loop.last %}{{ accesskey( "U") }}{% endif %}> {{ parent.title }}</ a > {{ reldelim1 }}</ li >
@@ -50,12 +37,12 @@ <h3>{{ _('Navigation') }}</h3>
5037
5138{%- macro sidebar() %}
5239 {%- if render_sidebar %}
53- < div class ="sphinxsidebar " role ="navigation " aria-label ="main navigation ">
40+ < div class ="sphinxsidebar " role ="navigation " aria-label ="Main ">
5441 < div class ="sphinxsidebarwrapper ">
5542 {%- block sidebarlogo %}
56- {%- if logo %}
57- < p class ="logo "> < a href ="{{ pathto(master_doc )|e }} ">
58- < img class ="logo " src ="{{ pathto('_static/' + logo, 1) |e }} " alt ="Logo "/>
43+ {%- if logo_url %}
44+ < p class ="logo "> < a href ="{{ pathto(root_doc )|e }} ">
45+ < img class ="logo " src ="{{ logo_url |e }} " alt ="{{ logo_alt|e }} "/>
5946 </ a > </ p >
6047 {%- endif %}
6148 {%- endblock %}
@@ -75,28 +62,23 @@ <h3>{{ _('Navigation') }}</h3>
7562 {%- block sidebarsourcelink %}
7663 {%- include "sourcelink.html" %}
7764 {%- endblock %}
78- {%- if customsidebar %}
79- {%- include customsidebar %}
80- {%- endif %}
8165 {%- block sidebarsearch %}
8266 {%- include "searchbox.html" %}
8367 {%- endblock %}
8468 {%- endif %}
8569 </ div >
70+ {%- block sidebarextra %}{%- endblock %}
8671 </ div >
8772 {%- endif %}
8873{%- endmacro %}
8974
9075{%- macro script() %}
91- < script id ="documentation_options " data-url_root ="{{ pathto('', 1) }} " src ="{{ pathto('_static/documentation_options.js', 1) }} "> </ script >
9276 {%- for js in script_files %}
9377 {{ js_tag(js) }}
9478 {%- endfor %}
9579{%- endmacro %}
9680
9781{%- macro css() %}
98- < link rel ="stylesheet " href ="{{ pathto('_static/' + style, 1)|e }} " type ="text/css " />
99- < link rel ="stylesheet " href ="{{ pathto('_static/pygments.css', 1) }} " type ="text/css " />
10082 {%- for css in css_files %}
10183 {%- if css|attr("filename") %}
10284 {{ css_tag(css) }}
@@ -109,17 +91,11 @@ <h3>{{ _('Navigation') }}</h3>
10991{%- if html_tag %}
11092{{ html_tag }}
11193{%- else %}
112- < html {% if not html5_doctype %} xmlns =" http://www.w3.org/1999/xhtml " {% endif %}{% if language is not none %} lang ="{{ language }} "{% endif %} >
94+ < html {% if language is not none %} lang ="{{ language }} "{% endif %} data-content_root =" {{ content_root }} " >
11395{%- endif %}
11496 < head >
115- {%- if not html5_doctype and not skip_ua_compatible %}
116- < meta http-equiv ="X-UA-Compatible " content ="IE=Edge " />
117- {%- endif %}
118- {%- if use_meta_charset or html5_doctype %}
11997 < meta charset ="{{ encoding }} " />
120- {%- else %}
121- < meta http-equiv ="Content-Type " content ="text/html; charset={{ encoding }} " />
122- {%- endif %}
98+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
12399 {{- metatags }}
124100 {%- block htmltitle %}
125101 < title > {{ title|striptags|e }}{{ titlesuffix }}</ title >
@@ -139,8 +115,8 @@ <h3>{{ _('Navigation') }}</h3>
139115 title ="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %} "
140116 href ="{{ pathto('_static/opensearch.xml', 1) }} "/>
141117 {%- endif %}
142- {%- if favicon %}
143- < link rel ="shortcut icon " href ="{{ pathto('_static/' + favicon, 1) |e }} "/>
118+ {%- if favicon_url %}
119+ < link rel ="icon " href ="{{ favicon_url |e }} "/>
144120 {%- endif %}
145121 {%- endif %}
146122{%- block linktags %}
@@ -196,14 +172,30 @@ <h3>{{ _('Navigation') }}</h3>
196172
197173{%- block relbar2 %}{{ relbar() }}{% endblock %}
198174
175+ {%- macro copyright_block() %}
176+ {%- if hasdoc('copyright') %}
177+ {%- set copyright_prefix = '< a href ="' + pathto('copyright') + ' "> ' + _('Copyright') + '</ a > ' -%}
178+ {%- else %}
179+ {%- set copyright_prefix = _('Copyright') %}
180+ {%- endif %}
181+ {%- if copyright is iterable and copyright is not string %}
182+ {% for copyright_line in copyright %}
183+ {% trans trimmed copyright_prefix=copyright_prefix, copyright=copyright_line|e %}
184+ © {{ copyright_prefix }} {{ copyright }}.
185+ {% endtrans %}
186+ {%- if not loop.last %}< br /> {%- endif %}
187+ {% endfor %}
188+ {%- else %}
189+ {% trans trimmed copyright_prefix=copyright_prefix, copyright=copyright|e %}
190+ © {{ copyright_prefix }} {{ copyright }}.
191+ {% endtrans %}
192+ {%- endif %}
193+ {%- endmacro %}
194+
199195{%- block footer %}
200196 < div class ="footer " role ="contentinfo ">
201197 {%- if show_copyright %}
202- {%- if hasdoc('copyright') %}
203- {% trans path=pathto('copyright'), copyright=copyright|e %}© < a href ="{{ path }} "> Copyright</ a > {{ copyright }}.{% endtrans %}
204- {%- else %}
205- {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %}
206- {%- endif %}
198+ {{- copyright_block() -}}
207199 {%- endif %}
208200 {%- if last_updated %}
209201 {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %}
0 commit comments