Skip to content

Commit e26854e

Browse files
committed
update versioning html
1 parent a046547 commit e26854e

File tree

2 files changed

+33
-100
lines changed

2 files changed

+33
-100
lines changed

docsrc/source/_static/custom.css

Lines changed: 14 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,19 @@
1-
/* Style our version picker
2-
3-
The version picker is defined in `_templates/versioning.html` and uses the same classes
4-
and ids as the one provided by the theme for use with readthedocs.io
5-
This allows us to load the styles by readthedocs as a basis
6-
and adjust them to our likings.
7-
*/
8-
9-
/* Import RTD styles */
10-
@import url("https://assets.readthedocs.org/static/css/readthedocs-doc-embed.css");
11-
@import url("https://assets.readthedocs.org/static/css/badge_only.css");
12-
13-
/* remove border around version picker */
14-
#furo-readthedocs-versions:focus-within,
15-
#furo-readthedocs-versions:hover {
16-
box-shadow: none;
17-
}
18-
19-
/* adjust the element showing the selected version */
20-
.rst-versions .rst-current-version {
21-
padding: var(--sidebar-item-spacing-vertical)
22-
var(--sidebar-item-spacing-horizontal);
23-
border-top: 1px solid var(--color-sidebar-search-border);
24-
color: var(--color-foreground-primary);
25-
}
26-
27-
/* .rst-versions .rst-current-version.rst-out-of-date {
28-
color: #c64334;
1+
.sidebar-primary-item .rst-versions p.caption {
2+
margin-bottom: 0;
3+
padding-left: 0.65rem;
4+
font-weight: 600;
295
}
30-
31-
.rst-versions .rst-current-version.rst-active-old-version {
32-
color: #634f00;
33-
} */
34-
35-
/* adjust the element listing all available versions */
36-
#furo-readthedocs-versions > .rst-other-versions {
37-
padding: var(--sidebar-item-spacing-vertical)
38-
var(--sidebar-item-spacing-horizontal);
39-
border-style: none;
40-
border-top: 1px solid var(--color-sidebar-search-border);
41-
}
42-
43-
/* adjust list headings */
44-
.rst-versions .rst-other-versions dt {
45-
color: var(--color-foreground-secondary);
6+
.sidebar-primary-item .rst-versions ul {
7+
display: block;
8+
list-style: none;
9+
margin-bottom: 0.2rem;
4610
}
47-
48-
/* adjust selectable version items */
49-
.rst-versions .rst-other-versions dd a {
50-
color: var(--color-sidebar-link-text--top-level);
51-
padding-left: 0px;
52-
padding-right: 12px;
53-
}
54-
55-
/* adjust icons for the list headings */
56-
.bi.version-header {
57-
margin-right: 1ch;
11+
.sidebar-primary-item .rst-versions li {
12+
display: list-item;
13+
text-align: match-parent;
5814
}
5915

60-
/* adjust icon for the version picker */
61-
.rst-current-version .bi-git {
62-
float: left;
63-
color: var(--color-foreground-primary);
64-
left: var(--sidebar-item-spacing-horizontal);
16+
.sidebar-primary-item .rst-versions .current {
17+
color: var(--pst-color-accent);
18+
font-weight: 600;
6519
}
Lines changed: 19 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,20 @@
1-
<div
2-
class="rst-versions"
3-
data-toggle="rst-versions"
4-
role="note"
5-
aria-label="{{ _('Versions') }}"
6-
tabindex="0"
7-
>
8-
{# this element shows the current version and is visible by default It hides
9-
on hover while the element below becomes appears in its place. #}
10-
<span class="rst-current-version" data-toggle="rst-current-version">
11-
{# git icon indicating the version selector #}
12-
<i class="bi bi-git"></i>
13-
{# show current version; prepend `v` in case of branches #} {% if not
14-
current or not current.name.startswith("v") %} v: {% endif %} {{
15-
current.name if current else "undefined" }}
16-
</span>
17-
{% if revisions %} {# This item lists the avaible versions grouped into
18-
branches and tags. The item is hidden by default but appears when the user
19-
hovers over the version selector. #}
20-
<div class="rst-other-versions">
21-
{% if tags %} {# List of tags #}
22-
<dl>
23-
<dt>
24-
<i class="bi bi-tags-fill version-header"></i>{{ _('Tags') }}
25-
</dt>
26-
{% for item in tags %}
27-
<dd><a href="../{{ item.name }}/index.html" {% if current and current.name == item.name %}class="current"{%endif%}>{{ item.name }}</a></dd>
28-
{% endfor %}
29-
</dl>
30-
{% endif %} {% if branches %} {# List of branches #}
31-
<dl>
32-
<dt><i class="bi bi-git version-header"></i>{{ _('Branches') }}</dt>
33-
{% for item in branches %}
34-
{% if current and current.name == item.name %}Huhu{% endif %}
35-
<dd><a href="../{{ item.name }}/index.html" {% if current and current.name == item.name %}class="current"{% endif %}>{{ item.name }}</a></dd>
36-
{% endfor %}
37-
</dl>
38-
{% endif %}
39-
</div>
40-
{% endif %}
1+
{% if revisions %}
2+
<div class="rst-versions">
3+
{% if tags %} {# List of tags #}
4+
<p class="caption" aria-level="2" role="heading"><span class="caption-text">{{ _('Tags') }}</span></p>
5+
<ul>
6+
{%- for item in tags %}
7+
<li><a href="../{{ item.name }}/index.html" {% if current and current.name == item.name %}class="current"{% endif %}>{{ item.name }}</a></li>
8+
{%- endfor %}
9+
</ul>
10+
{% endif %}
11+
{% if branches %} {# List of branches #}
12+
<p class="caption" aria-level="2" role="heading"><span class="caption-text">{{ _('Branches') }}</span></p>
13+
<ul>
14+
{%- for item in branches %}
15+
<li><a href="../{{ item.name }}/index.html" {% if current and current.name == item.name %}class="current"{% endif %}>{{ item.name }}</a></li>
16+
{%- endfor %}
17+
</ul>
18+
{% endif %}
4119
</div>
20+
{% endif %}

0 commit comments

Comments
 (0)