Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 611a1dc

Browse files
committed
Add switchers to desktop view
Signed-off-by: Olga Bulat <[email protected]>
1 parent 1e182f3 commit 611a1dc

File tree

2 files changed

+33
-15
lines changed

2 files changed

+33
-15
lines changed

python_docs_theme/layout.html

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,27 @@
55
<div class="related" role="navigation" aria-label="related navigation">
66
<h3>{{ _('Navigation') }}</h3>
77
<ul>
8-
{%- for rellink in rellinks %}
9-
<li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}>
10-
<a href="{{ pathto(rellink[0])|e }}" title="{{ rellink[1]|striptags|e }}"
11-
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
12-
{%- if not loop.first %}{{ reldelim2 }}{% endif %}
13-
</li>
14-
{%- endfor %}
15-
{%- block rootrellink %}
16-
<li><img src="{{ pathto('_static/py.svg', 1) }}" alt=""
17-
style="vertical-align: middle; margin-top: -1px"/></li>
18-
<li><a href="{{theme_root_url}}">{{theme_root_name}}</a>{{ reldelim1 }}</li>
19-
{% if theme_root_include_title %}
20-
<a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}
21-
{% endif %}
22-
{%- endblock %}
8+
{%- for rellink in rellinks %}
9+
<li class="right" {% if loop.first %}style="margin-right: 10px"{% endif %}>
10+
<a href="{{ pathto(rellink[0])|e }}" title="{{ rellink[1]|striptags|e }}"
11+
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}
12+
</a>
13+
{%- if not loop.first %}{{ reldelim2 }}{% endif %}
14+
</li>
15+
{%- endfor %}
16+
{%- block rootrellink %}
17+
<li><img src="{{ pathto('_static/py.svg', 1) }}" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
18+
<li><a href="{{theme_root_url}}">{{theme_root_name}}</a>{{ reldelim1 }}</li>
19+
<li class="switchers">
2320
<div class="language_switcher_placeholder"></div>
2421
<div class="version_switcher_placeholder"></div>
22+
</li>
23+
<li>
24+
{% if theme_root_include_title %}
25+
<a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}
26+
{% endif %}
27+
</li>
28+
{%- endblock %}
2529
{%- for parent in parents %}
2630
<li class="nav-item nav-item-{{ loop.index }}"><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li>
2731
{%- endfor %}

python_docs_theme/static/pydoctheme.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ div.related ~ div.related {
2727
border-bottom: none;
2828
}
2929

30+
.related .switchers {
31+
display: inline-flex;
32+
}
33+
34+
.switchers > div {
35+
margin-right: 5px;
36+
}
37+
38+
.version_switcher_placeholder,
39+
.language_switcher_placeholder {
40+
padding-left: 3px;
41+
background-color: white;
42+
}
43+
3044
.inline-search {
3145
display: inline;
3246
}

0 commit comments

Comments
 (0)