Skip to content

Commit ce324fd

Browse files
authored
Merge pull request #1024 from xylar/add-version-side-bar
Add versions to sidebar
2 parents cb3f60e + 776fb46 commit ce324fd

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

docs/_templates/versions.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{%- if current_version %}
2+
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
3+
<span class="rst-current-version" data-toggle="rst-current-version">
4+
<span class="fa fa-book"> Other Versions</span>
5+
v: {{ current_version.name }}
6+
<span class="fa fa-caret-down"></span>
7+
</span>
8+
<div class="rst-other-versions">
9+
{%- if versions.tags %}
10+
<dl>
11+
<dt>Tags</dt>
12+
{%- for item in versions.tags %}
13+
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
14+
{%- endfor %}
15+
</dl>
16+
{%- endif %}
17+
{%- if versions.branches %}
18+
<dl>
19+
<dt>Branches</dt>
20+
{%- for item in versions.branches %}
21+
<dd><a href="{{ item.url }}">{{ item.name }}</a></dd>
22+
{%- endfor %}
23+
</dl>
24+
{%- endif %}
25+
</div>
26+
</div>
27+
{%- endif %}
28+

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
'sphinx.ext.viewcode',
4343
'sphinx.ext.napoleon']
4444

45+
# Add any paths that contain templates here, relative to this directory.
46+
templates_path = ["_templates"]
47+
4548
autosummary_generate = True
4649

4750
# Otherwise, the Return parameter list looks different from the Parameters list

0 commit comments

Comments
 (0)