Welcome to mirror list, hosted at ThFree Co, Russian Federation.

version.html « shortcodes « layouts - github.com/uPagge/uBlogger.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 079a06582c1f4f82e7d34dc7eafd7e1049176111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{{- $version := .Get 0 -}}
{{- $url := printf "https://github.com/upagge/uBlogger/releases/tag/v%v" $version -}}
{{- $type := .Get 1 | default "new" | lower -}}
{{- $label := T $type -}}
{{- $color := cond (eq $type "changed") "ff9101" "00b1ff" | cond (eq $type "deleted") "ff5252" -}}
{{- $pathTemplate := cond .Site.IsMultiLingual (printf "svg/version/%%v-%%v.%v.svg" .Page.Language.Lang) "svg/version/%v-%v.svg" -}}
{{- $path := printf $pathTemplate $version $type -}}
{{- $resource := resources.Get "svg/version.template.svg" -}}
{{- $resource = $resource | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color) | minify -}}
{{- $alt := printf "uBlogger %v | %v" $label $version -}}
<a href="{{ $url }}" rel="noopener noreffer" target="_blank">
    {{- dict "Src" $resource.RelPermalink "Alt" $alt "Class" "version" | partial "plugin/image.html" -}}
</a>