diff --git a/themes/psh-docs/layouts/shortcodes/latest.html b/themes/psh-docs/layouts/shortcodes/latest.html index 9c9ffe925e..cab12aa7f5 100644 --- a/themes/psh-docs/layouts/shortcodes/latest.html +++ b/themes/psh-docs/layouts/shortcodes/latest.html @@ -1,25 +1,4 @@ {{- $arg := .Get 0 -}} {{- $data := cond (eq $arg "composable") .Site.Data.composable_versions .Site.Data.registry -}} {{- $supported := index $data $arg "versions" "supported" -}} - -{{- $latest := index $supported 0 -}} - -{{- range $supported -}} - {{- $current := . -}} - {{- $currentParts := split $current "." -}} - {{- $latestParts := split $latest "." -}} - - {{- $currentMajor := int (index $currentParts 0) -}} - {{- $currentMinor := int (index $currentParts 1) -}} - {{- $latestMajor := int (index $latestParts 0) -}} - {{- $latestMinor := int (index $latestParts 1) -}} - - {{- if gt $currentMajor $latestMajor -}} - {{- $latest = $current -}} - {{- else if and (eq $currentMajor $latestMajor) (gt $currentMinor $latestMinor) -}} - {{- $latest = $current -}} - {{- end -}} -{{- end -}} - -{{- $latest -}} - +{{- index $supported 0 -}}