2020-03-19 09:54:47 +01:00
|
|
|
{{- $version := .Get 0 -}}
|
2020-05-18 10:10:24 +02:00
|
|
|
{{- $url := printf "https://github.com/dillonzq/LoveIt/releases/tag/v%v" $version -}}
|
2020-04-18 14:54:54 +02:00
|
|
|
{{- $type := .Get 1 | default "new" | lower -}}
|
|
|
|
{{- $label := T $type -}}
|
|
|
|
{{- $color := cond (eq $type "changed") "ff9101" "00b1ff" | cond (eq $type "deleted") "ff5252" -}}
|
2020-05-18 10:10:24 +02:00
|
|
|
{{- $pathTemplate := cond .Site.IsMultiLingual (printf "svg/version/%%v-%%v.%v.svg" .Page.Language.Lang) "svg/version/%v-%v.svg" -}}
|
2020-04-26 17:00:29 +02:00
|
|
|
{{- $path := printf $pathTemplate $version $type -}}
|
2020-05-28 11:05:37 +02:00
|
|
|
{{- $resource := resources.Get "svg/version.template.svg" -}}
|
|
|
|
{{- $resource = $resource | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color) | minify -}}
|
2020-05-18 10:10:24 +02:00
|
|
|
{{- $alt := printf "LoveIt %v | %v" $label $version -}}
|
2020-05-01 17:29:24 +02:00
|
|
|
<a href="{{ $url }}" rel="noopener noreffer" target="_blank">
|
2022-05-13 20:28:35 +02:00
|
|
|
{{- dict "Src" $resource.RelPermalink "Alt" $alt "Class" "version" | partial "plugin/img.html" -}}
|
2020-05-01 17:29:24 +02:00
|
|
|
</a>
|