Back to Yugabyte Db

Release

docs/layouts/_shortcodes/release.html

2026.1.0.0-b292.4 KB
Original Source

{{- /* first arg is the version as a comma delimited string, spaces allowed */ -}} {{- $versions := .Get 0 -}} {{- /* second arg is one of ybdb/yba. ybdb is default */ -}} {{- $product := default "ybdb" (.Get 1) -}} {{- $versions = split $versions "," -}} {{- $numversions := len $versions -}} {{- $count := 0 -}} {{- range $version := $versions -}} {{- if or (eq $version "preview") (eq $version "stable") -}} {{- range page.Site.Data.currentVersions.dbVersions -}} {{- if eq $version .alias -}} {{- $version = .version -}} {{- break -}} {{- end -}} {{- end -}} {{- end -}} {{- /* retain the original text for display */ -}} {{- $orig := trim $version " " -}} {{- /* trim the spaces,+,.,x,X */ -}} {{- $version = trim $version " .+xX" -}} {{- $count = add $count 1 -}} {{- /* split the build part eg: -b12 */ -}} {{- $parts := split $version "-" -}} {{- $build := "" -}} {{- if gt (len $parts) 1 -}} {{- $build = index $parts 1 -}} {{ $version = index $parts 0 -}}{{- end -}} {{- /* identify the base version eg 2.20 for 2.20.1.0 */ -}} {{- $parts = split $version "." -}} {{- $base := printf "%s.%s" (index $parts 0) (index $parts 1) -}} {{- /* eg: 2.20.1.x/2.20.1+ --> 2.20.1 */ -}} {{- if eq (len $parts) 3 -}} {{- $version = printf "%s.0" $version -}} {{- end -}} {{- if or (eq $product "ybdb") (eq $product "yba") -}} {{- if eq "all" (lower $version) -}} {{- /* link to the main release page in case of All */ -}} {{- printf "%s" $orig -}} {{- else -}} {{- /* Check if the release exists in end-of-life directory */ -}} {{- $eolPath := printf "/stable/releases/%s-releases/end-of-life/v%s" $product $base -}} {{- $eolPage := $.Site.GetPage $eolPath -}} {{- $releasePath := "" -}} {{- if $eolPage -}} {{- /* Release is in end-of-life directory */ -}} {{- $releasePath = printf "/stable/releases/%s-releases/end-of-life/v%s" $product $base -}} {{- else -}} {{- /* Release is in regular directory */ -}} {{- $releasePath = printf "/stable/releases/%s-releases/v%s" $product $base -}} {{- end -}} {{- if eq $base $version -}} {{- /* If the version is the base version point to the top of the page */ -}} {{- printf "v%s" $orig -}} {{- else -}} {{- /* If it is a specific version add the anchor */ -}} {{- printf "v%s" $orig -}} {{- end -}} {{- end -}} {{- /* don't add a comma to the last version */ -}} {{- if ne $numversions $count -}} {{- print ", " }} {{end -}} {{- end -}} {{- end -}}