Add currentPatchVersion type to skew shortcode
You can now use {{< skew currentPatchVersion >}} as a Hugo shortcode,
and it will render to the patch SemVer for the minor release that is
being documented.
pull/40692/head
parent
ef662086a6
commit
2483de1783
|
|
@ -77,6 +77,25 @@
|
|||
{{- $currentVersionAddMinor -}}
|
||||
{{- end -}}
|
||||
|
||||
<!-- output patch version for current release -->
|
||||
{{- if eq $version "currentPatchVersion" -}}
|
||||
{{- $seenPatchVersionInfoCount := 0 }}
|
||||
{{- range $releaseInfo := .Site.Data.releases.schedule.schedules -}}
|
||||
{{- if eq $currentVersion ( printf "%.2f" $releaseInfo.release ) -}}
|
||||
{{- range $patchReleaseInfo := $releaseInfo.previousPatches -}}
|
||||
{{- if eq $seenPatchVersionInfoCount 0 -}}
|
||||
{{- $patchReleaseInfo.release -}}
|
||||
{{- end -}}
|
||||
{{- $seenPatchVersionInfoCount = add $seenPatchVersionInfoCount 1 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if eq $seenPatchVersionInfoCount 0 -}}
|
||||
<!-- fallback patch version to .0 -->
|
||||
{{- printf "%.2f.0" $currentVersion -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
<!--
|
||||
example shortcode use:
|
||||
- skew nextMinorVersion
|
||||
|
|
|
|||
Loading…
Reference in New Issue