Back to Yugabyte Db

Navbar Version Selector

docs/layouts/_partials/navbar-version-selector.html

2026.1.0.0-b252.1 KB
Original Source

{{ $versionName := .Site.Params.version_menu }} {{ $pagePermalink := .Page.RelPermalink }} {{ range .Site.Params.versions }} {{ $versionUrl := printf "%s/" .url }} {{ if hasPrefix $pagePermalink $versionUrl }} {{ $versionName = .version }} {{- if in .version "(Preview)" -}} {{ $versionName = replace .version "(Preview)" "Preview Preview release - not for production" }} {{- else if in .version "(STS)" -}} {{ $versionName = replace .version "(STS)" "STS Stable release with standard-term support" }} {{- else if in .version "(LTS)" -}} {{ $versionName = replace .version "(LTS)" "LTS Stable release with long-term support" }} {{ end }} {{ end }} {{ end }} {{ $versionName | safeHTML }}

{{ $path := "" }} {{ if .Site.Params.version_menu_pagelinks }} {{ $pathArray := split .Page.RelPermalink "/" }} {{ $path = path.Join (after 2 $pathArray) }} {{- if eq $path "" -}} {{ $path = add $path "/" }} {{- else }} {{ $path = add (add "/" $path) "/" }} {{ end }} {{ end }} {{ range .Site.Params.versions }} {{ $versionName := .version }} {{- if in .version "(Preview)" -}} {{ $versionName = replace .version "(Preview)" "Preview Preview release - not for production" }} {{- else if in .version "(STS)" -}} {{ $versionName = replace .version "(STS)" "STS Stable release with standard-term support" }} {{- else if in .version "(LTS)" -}} {{ $versionName = replace .version "(LTS)" "LTS Stable release with long-term support" }} {{- else if in .version "Unsupported" -}} {{ $path = "/" }} {{ end }} {{ $content_path := printf "content%s%s" .url $path }} {{ $content_path = $content_path | replaceRE "/$" "" }} {{ $check_file_md := printf "%s.md" $content_path }} {{ $check_file_html := printf "%s.html" $content_path }} {{ $check_index_md := printf "%s/_index.md" $content_path }} {{ $check_index_html := printf "%s/_index.html" $content_path }} {{ if or (fileExists $check_file_md) (fileExists $check_file_html) (fileExists $check_index_md) (fileExists $check_index_html) (in .url "https://") }} {{ $versionName | safeHTML }} {{ else }} {{ $versionName | safeHTML }} {{ end }} {{ end }}