File tree Expand file tree Collapse file tree 2 files changed +20
-13
lines changed
src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components Expand file tree Collapse file tree 2 files changed +20
-13
lines changed Original file line number Diff line number Diff line change 175
175
# "footer_start": ["test.html", "test.html"],
176
176
# "secondary_sidebar_items": ["page-toc.html"], # Remove the source buttons
177
177
"switcher" : {
178
+ "use_rtd" : True ,
178
179
"json_url" : json_url ,
179
180
"version_match" : version_match ,
180
181
},
Original file line number Diff line number Diff line change 1
1
{# As the version switcher will only work when JavaScript is enabled, we add it through JavaScript.
2
2
#}
3
- < script >
4
- document . write ( `
5
- <div class="version-switcher__container dropdown">
6
- <button id="versionswitcherbutton" type="button" role="button" class="version-switcher__button btn btn-sm navbar-btn dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="listbox" aria-controls="versionswitcherlist" aria-label="Version switcher list">
7
- {{ theme_switcher.get('version_match') }} <!-- this text may get changed later by javascript -->
8
- <span class="caret"></span>
9
- </button>
10
- <div id="versionswitcherlist" class="version-switcher__menu dropdown-menu list-group-flush py-0" role="listbox" aria-labelledby="versionswitcherbutton">
11
- <!-- dropdown will be populated by javascript on page load -->
12
- </div>
13
- </div>
14
- ` ) ;
15
- </ script >
3
+ {% if theme_switcher.get('use_rtd') is defined and theme_switcher.get('use_rtd') %}
4
+ < script >
5
+ document . write ( `<div id="readthedocs-embed-flyout"></div>` ) ;
6
+ </ script >
7
+ {% else %}
8
+ < script >
9
+ document . write ( `
10
+ <div class="version-switcher__container dropdown">
11
+ <button id="versionswitcherbutton" type="button" role="button" class="version-switcher__button btn btn-sm navbar-btn dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="listbox" aria-controls="versionswitcherlist" aria-label="Version switcher list">
12
+ {{ theme_switcher.get('version_match') }} <!-- this text may get changed later by javascript -->
13
+ <span class="caret"></span>
14
+ </button>
15
+ <div id="versionswitcherlist" class="version-switcher__menu dropdown-menu list-group-flush py-0" role="listbox" aria-labelledby="versionswitcherbutton">
16
+ <!-- dropdown will be populated by javascript on page load -->
17
+ </div>
18
+ </div>
19
+ ` ) ;
20
+ </ script >
21
+ {% endif %}
You can’t perform that action at this time.
0 commit comments