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+ // taken from https://github.com/readthedocs/sphinx_rtd_theme/blob/3.0.2/sphinx_rtd_theme/static/js/versions.js_t
2+
3+ function onSelectorSwitch ( event ) {
4+ const option = event . target . selectedIndex ;
5+ const item = event . target . options [ option ] ;
6+ window . location . href = item . dataset . url ;
7+ }
8+
9+ document . addEventListener ( "readthedocs-addons-data-ready" , function ( event ) {
10+ const config = event . detail . data ( ) ;
11+
12+ const versionSwitch = document . querySelector (
13+ "div.version-switch" ,
14+ ) ;
15+ let versions = config . versions . active ;
16+ if ( config . versions . current . hidden || config . versions . current . type === "external" ) {
17+ versions . unshift ( config . versions . current ) ;
18+ }
19+ const versionSelect = `
20+ <select>
21+ ${ versions
22+ . map (
23+ ( version ) => `
24+ <option
25+ value="${ version . slug } "
26+ ${ config . versions . current . slug === version . slug ? 'selected="selected"' : "" }
27+ data-url="${ version . urls . documentation } ">
28+ ${ version . slug }
29+ </option>` ,
30+ )
31+ . join ( "\n" ) }
32+ </select>
33+ ` ;
34+
35+ versionSwitch . innerHTML = versionSelect ;
36+ versionSwitch . firstElementChild . addEventListener ( "change" , onSelectorSwitch ) ;
37+ } )
Original file line number Diff line number Diff line change @@ -158,8 +158,8 @@ def setup(sphinx):
158158# of the sidebar.
159159html_theme_options = {
160160 "sidebar_hide_name" : True ,
161- "light_logo" : "spack-logo-text.svg" ,
162- "dark_logo" : "spack-logo-white-text.svg" ,
161+ "light_logo" : "images/ spack-logo-text.svg" ,
162+ "dark_logo" : "images/ spack-logo-white-text.svg" ,
163163}
164164
165165# The name of an image file (within the static path) to use as favicon of the
You can’t perform that action at this time.
0 commit comments