File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {# Version switcher flyout.
2+
3+ sphinx_rtd_theme 3.x ships an empty versions.html (the flyout is injected by
4+ the ReadTheDocs addons when hosted there, and is absent on self-hosted
5+ builds). layout.html still does `{% include "versions.html" %}`, so this
6+ override revives the classic bottom-left "v: < version > ▾" widget. It is
7+ styled by the theme's existing .rst-versions CSS and toggled by theme.js;
8+ the entries come from html_context['versions'] in conf.py. #}
9+ {%- if versions %}
10+ < div class ="rst-versions " data-toggle ="rst-versions " role ="note " aria-label ="{{ _('Versions') }} ">
11+ < span class ="rst-current-version " data-toggle ="rst-current-version ">
12+ < span class ="fa fa-book "> {{ _('Versions') }}</ span >
13+ v: {{ current_version }}
14+ < span class ="fa fa-caret-down "> </ span >
15+ </ span >
16+ < div class ="rst-other-versions ">
17+ < dl >
18+ < dt > {{ _('Versions') }}</ dt >
19+ {%- for slug, url in versions %}
20+ < dd > < a href ="{{ url }} "> {{ slug }}</ a > </ dd >
21+ {%- endfor %}
22+ </ dl >
23+ </ div >
24+ </ div >
25+ {%- endif %}
Original file line number Diff line number Diff line change @@ -92,7 +92,22 @@ html_theme_options = {
9292
9393html_show_sphinx = True
9494nbsphinx_allow_errors = True
95- html_context = {'header_title': '@PROJECT_NAME@'}
95+ html_context = {
96+ 'header_title': '@PROJECT_NAME@',
97+ # Version switcher flyout (rendered by _templates/versions.html, which
98+ # overrides the empty versions.html shipped by sphinx_rtd_theme 3.x). The
99+ # list is static -- update it when a new release line is published.
100+ # display_lower_left enables the flyout on older theme versions that gate
101+ # the include on it; harmless on 3.x.
102+ 'display_lower_left': True,
103+ 'current_version': version,
104+ 'versions': [
105+ ['latest', 'https://triqs.github.io/solid_dmft/latest/'],
106+ ['unstable', 'https://triqs.github.io/solid_dmft/unstable/'],
107+ ['4.0.x', 'https://triqs.github.io/solid_dmft/4.0.x/'],
108+ ['3.3.x', 'https://triqs.github.io/solid_dmft/3.3.x/'],
109+ ],
110+ }
96111html_static_path = ['@CMAKE_CURRENT_SOURCE_DIR@/_static']
97112html_sidebars = {'index': ['sideb.html', 'searchbox.html']}
98113
You can’t perform that action at this time.
0 commit comments