1919 </ svg >
2020 </ button >
2121
22+ <!-- Search Toggle Mobile -->
23+ {{ if site.Params.doks.flexSearch }}
24+ < button type ="button " id ="searchToggleMobile " class ="btn btn-link nav-link p-0 d-lg-none ms-auto me-3 "
25+ aria-label ="Search ">
26+ < svg xmlns ="http://www.w3.org/2000/svg " class ="icon icon-tabler icon-tabler-search " width ="24 "
27+ height ="24 " viewBox ="0 0 24 24 " stroke-width ="2 " stroke ="currentColor " fill ="none "
28+ stroke-linecap ="round " stroke-linejoin ="round ">
29+ < path stroke ="none " d ="M0 0h24v24H0z " fill ="none "> </ path >
30+ < path d ="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0 "> </ path >
31+ < path d ="M21 21l-6 -6 "> </ path >
32+ </ svg >
33+ </ button >
34+ {{ end }}
35+
2236 < div class ="offcanvas offcanvas-end " tabindex ="-1 " id ="offcanvasNavbar "
2337 aria-labelledby ="offcanvasNavbarLabel ">
2438 < div class ="offcanvas-header ">
@@ -40,8 +54,8 @@ <h5 class="offcanvas-title" id="offcanvasNavbarLabel">{{ site.Title }}</h5>
4054 < div class ="navbar-right ">
4155 <!-- Search Placeholder or Partial -->
4256 {{ if site.Params.doks.flexSearch }}
43- < button type ="button " class =" btn btn-link nav-link p-0 me-3 d-none d-lg-flex "
44- aria-label =" Search " data-bs-toggle =" modal " data-bs-target =" #searchModal ">
57+ < button type ="button " id =" searchToggleDesktop "
58+ class =" btn btn-link nav-link p-0 me-3 d-none d-lg-flex " aria-label =" Search ">
4559 < svg xmlns ="http://www.w3.org/2000/svg " class ="icon icon-tabler icon-tabler-search "
4660 width ="20 " height ="20 " viewBox ="0 0 24 24 " stroke-width ="2 " stroke ="currentColor "
4761 fill ="none " stroke-linecap ="round " stroke-linejoin ="round ">
@@ -61,6 +75,44 @@ <h5 class="offcanvas-title" id="offcanvasNavbarLabel">{{ site.Title }}</h5>
6175 </ a >
6276 {{ end }}
6377
78+ <!-- Version switches always navigate to the Root page of the selected version -->
79+ {{ if site.Params.doks.docsVersioning -}}
80+ {{ $versionsData := site.Data.versions -}}
81+ {{ if $versionsData.versions -}}
82+ {{ $currentVer := site.Params.doks.docsVersion -}}
83+ < div class ="dropdown me-3 d-none d-lg-flex ">
84+ < button class ="btn btn-link nav-link p-0 dropdown-toggle btn-dropdown " id ="doks-versions "
85+ data-bs-toggle ="dropdown " aria-expanded ="false " data-bs-display ="static "
86+ aria-label ="Toggle version menu ">
87+ Versions
88+ < span class ="dropdown-caret ">
89+ < svg xmlns ="http://www.w3.org/2000/svg "
90+ class ="icon icon-tabler icon-tabler-chevron-down " width ="20 " height ="20 "
91+ viewBox ="0 0 24 24 " stroke-width ="1.5 " stroke ="currentColor " fill ="none "
92+ stroke-linecap ="round " stroke-linejoin ="round ">
93+ < path stroke ="none " d ="M0 0h24v24H0z " fill ="none " />
94+ < path d ="M6 9l6 6l6 -6 " />
95+ </ svg >
96+ </ span >
97+ </ button >
98+ < ul class ="dropdown-menu dropdown-menu-lg-end shadow rounded border-0 "
99+ aria-labelledby ="doks-versions ">
100+ {{ range $versionsData.versions -}}
101+ {{ $isDefault := eq . $versionsData.defaultVersion -}}
102+ {{ $isCurrent := eq . $currentVer -}}
103+ < li >
104+ < a class ="dropdown-item{{ if $isCurrent }} current{{ end }} " {{ if $isCurrent
105+ }}aria-current ="true " {{ end }}
106+ href ="{{ if $isDefault }}/{{ else }}/{{ . }}/{{ end }} ">
107+ {{ . }}{{ if $isDefault }} < span class ="version-flag "> (default)</ span > {{ end }}
108+ </ a >
109+ </ li >
110+ {{ end -}}
111+ </ ul >
112+ </ div >
113+ {{ end -}}
114+ {{ end -}}
115+
64116 <!-- Theme Toggle -->
65117 {{ if and (eq site.Params.doks.colorMode "auto") site.Params.doks.colorModeToggler -}}
66118 < button id ="buttonColorMode " class ="btn btn-link nav-link p-0 mode-toggle " type ="button "
@@ -91,8 +143,9 @@ <h5 class="offcanvas-title" id="offcanvasNavbarLabel">{{ site.Title }}</h5>
91143 </ div >
92144 </ div >
93145 </ nav >
146+ </ header >
94147
95- {{ if site.Params.doks.flexSearch }}
96- {{ partial "header/search-modal" . }}
97- {{ end }}
98- </ header >
148+ {{ if site.Params.doks.flexSearch }}
149+ {{ partial "header/search-modal" . }}
150+ {{ end }}
151+ {{ partial " header/version-warning.html" . }}
0 commit comments