Merge pull request #305 from gethinode/develop

Exclude 'latest' label from version check
This commit is contained in:
Mark Dumay
2023-06-20 09:18:26 +02:00
committed by GitHub
2 changed files with 3 additions and 11 deletions

View File

@@ -3,10 +3,9 @@
{{- $.Scratch.Set "version" $version -}}
{{ with partial "utilities/GetMenu" (dict "page" . "version" $version) }}{{ $.Scratch.Set "sidebar" . }}{{ end }}
{{- if site.Params.docs.checkVersion -}}
{{ with $version }}
{{- $isOlder := partial "utilities/IsOlder" (dict "current" .) -}}
{{- if $isOlder }}
{{- if and site.Params.docs.checkVersion $version -}}
{{- if ne $version "latest" -}}
{{- if partial "utilities/IsOlder" (dict "current" $version) -}}
{{- $.Scratch.Set "pageAlertMsg" (T "newerVersionAlert" site.Title) -}}
{{- $.Scratch.Set "pageAlertURL" (or site.Params.docs.latestURL site.baseURL) -}}
{{- end -}}

View File

@@ -1,7 +0,0 @@
{{ with .version }}
{{- $isOlder := partial "utilities/IsOlder" (dict "current" .) -}}
{{- if $isOlder }}
{{- $.Scratch.Set "pageAlertMsg" (printf "There is a newer version of %s!" site.Title) -}}
{{- $.Scratch.Set "pageAlertURL" "https://getbootstrap.com/docs" -}}
{{- end -}}
{{- end -}}