forked from keptn-sandbox/lifecycle-toolkit-docs
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnavbar-version-selector.html
More file actions
26 lines (25 loc) · 1004 Bytes
/
navbar-version-selector.html
File metadata and controls
26 lines (25 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<a data-proofer-ignore class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ .Site.Params.version_menu }}
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
{{ range sort .Site.Pages ".File.ContentBaseName" "desc" -}}
{{ if (findRE "docs" .File.ContentBaseName) -}}
{{ $versionFile := printf "%s%s" .File.Dir "/version" -}}
{{ if fileExists $versionFile -}}
<a class="dropdown-item" href="{{ .RelPermalink }}">
{{readFile ( $versionFile )}}
{{- if eq .File.ContentBaseName "docs" -}}
(latest)
{{- end -}}
</a>
{{ end -}}
{{ end -}}
{{ end -}}
{{ $path := "" }}
{{ if .Site.Params.version_menu_pagelinks }}
{{ $path = .Page.RelPermalink }}
{{ end }}
{{ range .Site.Params.versions }}
<a class="dropdown-item" href="{{ .url }}{{ $path }}">{{ .version }}</a>
{{ end }}
</div>