use maintained theme
This commit is contained in:
parent
640572ecab
commit
0c7cb4486a
1779 changed files with 41468 additions and 26258 deletions
13
themes/CodeIT/layouts/shortcodes/version.html
Normal file
13
themes/CodeIT/layouts/shortcodes/version.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
{{- $version := .Get 0 -}}
|
||||
{{- $url := printf "https://github.com/sunt-programator/CodeIT/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 "CodeIT %v | %v" $label $version -}}
|
||||
<a href="{{ $url }}" rel="noopener noreferrer" target="_blank">
|
||||
{{- dict "Src" $resource.RelPermalink "Alt" $alt "Class" "version" | partial "plugin/image.html" -}}
|
||||
</a>
|
Loading…
Add table
Add a link
Reference in a new issue