File tree Expand file tree Collapse file tree 2 files changed +64
-2
lines changed Expand file tree Collapse file tree 2 files changed +64
-2
lines changed Original file line number Diff line number Diff line change 23
23
{{ $currentPage := .}}
24
24
{{ range .Site.Menus.main }}
25
25
{{ $active := or (eq $currentPage.Title .Name) (or ($currentPage.HasMenuCurrent "main" .) ($currentPage.IsMenuCurrent "main" .)) }}
26
- {{ if .HasChildren }}
26
+ {{ if and (eq .Identifier "docs") (eq $.Section "docs") (not $.Site.Data.args.archive) }}
27
+ < li class ="main-navigation-links-item ">
28
+ < a href ="{{ .URL | relLangURL }} " class ="main-navigation-links-link has-dropdown {{ if $active }}active{{ end }} ">
29
+ < span > {{ .Name }}</ span >
30
+ {{ partial "icon.html" "dropdown-arrow" }}
31
+ </ a >
32
+
33
+ < ul class ="main-navigation-links-dropdown ">
34
+ {{ range .Children }}
35
+ < li class ="main-navigation-links-dropdown-item ">
36
+ < a href ="{{ .URL | relLangURL }} " class ="main-navigation-links-link "> {{ .Name }}</ a >
37
+ </ li >
38
+ {{ end }}
39
+
40
+
41
+ {{ partial "version-selector.html" $ }}
42
+
43
+ </ ul >
44
+ </ li >
45
+ {{else if .HasChildren }}
27
46
< li class ="main-navigation-links-item ">
28
47
< a {{ if ne .URL "" }}href="{{ .URL | relLangURL }} "{{end}} class ="main-navigation-links-link has-dropdown {{ if $active }}active{{ end }} ">
29
48
< span > {{ .Name }}</ span >
48
67
{{ end }}
49
68
</ ul >
50
69
70
+
71
+
51
72
< div class ="main-navigation-footer ">
52
73
< button id ="search-show " class ="search-show " title ='{{ i18n "search" }} ' aria-label ='{{ i18n "search_label" }} '> {{ partial "icon.html" "magnifier" }}</ button >
53
74
< a href ='{{ "/docs/overview/quickstart" | relLangURL }} ' class ="btn btn--primary " id ="try-istio "> {{ i18n "try_istio" }}</ a >
54
75
</ div >
55
-
56
76
</ div >
57
77
58
78
< form id ="search-form " class ="search " name ="cse " role ="search ">
69
89
< input id ="search-textbox " class ="search-textbox form-control " name ="q " type ="search " aria-label ='{{ i18n "search" }} ' placeholder ='{{ i18n "search_label" }} ' />
70
90
< button id ="search-close " title ='{{ i18n "search_cancel" }} ' type ="reset " aria-label ='{{ i18n "search_cancel" }} '> {{ partial "icon.html" "menu-close" }}</ button >
71
91
</ form >
92
+
93
+
72
94
</ nav >
73
95
</ header >
Original file line number Diff line number Diff line change
1
+ {{ $versions := site.Data.versions }}
2
+ {{ $mainVerStr := $versions.main }}
3
+ {{ $preliminaryVerStr := $versions.preliminary }}
4
+ {{ $mainVerParts := split $mainVerStr "." }}
5
+ {{ $major := index $mainVerParts 0 | int }}
6
+ {{ $minor := index $mainVerParts 1 | int }}
7
+ {{ $versionCount := 5 }}
8
+
9
+ <!-- Preliminary version -->
10
+ {{ $preUrl := printf "https://preliminary.istio.io/v%s/docs" $preliminaryVerStr }}
11
+ < li class ="main-navigation-links-dropdown-item ">
12
+ < a href ="{{ $preUrl }} "
13
+ class ="main-navigation-links-link ">
14
+ Preliminary
15
+ </ a >
16
+ </ li >
17
+
18
+ <!-- Main version -->
19
+ {{ $mainUrl := printf "https://istio.io/v%s/docs" $mainVerStr }}
20
+ < li class ="main-navigation-links-dropdown-item ">
21
+ < a href ="{{ $mainUrl }} "
22
+ class ="main-navigation-links-link ">
23
+ < strong > v{{ $mainVerStr }} (Current)</ strong >
24
+ </ a >
25
+ </ li >
26
+
27
+ <!-- Previous versions -->
28
+ {{ range $i := seq 1 (sub $versionCount 1) }}
29
+ {{ $currentMinor := sub $minor $i }}
30
+ {{ if ge $currentMinor 0 }}
31
+ {{ $ver := printf "v%d.%d" $major $currentMinor }}
32
+ {{ $url := printf "https://istio.io/%s/docs" $ver }}
33
+ < li class ="main-navigation-links-dropdown-item ">
34
+ < a href ="{{ $url }} "
35
+ class ="main-navigation-links-link ">
36
+ {{ $ver }}
37
+ </ a >
38
+ </ li >
39
+ {{ end }}
40
+ {{ end }}
You can’t perform that action at this time.
0 commit comments