docs: update theme preview and translation (#262)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
{{- $content := .Inner | .Page.RenderString -}}
|
||||
{{- $id := partial "function/id.html" (dict "content" $content) -}}
|
||||
{{- $tag := .Get 1 | default "div" -}}
|
||||
{{- printf `<%s style="%s">%s</%s>` $tag ($.Get 0) $content $tag | safeHTML -}}
|
||||
{{- printf `<%s id="%s">%s</%s><style>#%s{%s}</style>` $tag $id $content $tag $id ($.Get 0) | safeHTML -}}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
{{- $type := .Get 1 | default "new" | lower -}}
|
||||
{{- $label := T $type -}}
|
||||
{{- $color := cond (eq $type "changed") "ff9101" "00b1ff" | cond (eq $type "deleted") "ff5252" -}}
|
||||
{{- $path := printf "svg/version/%s-%s.svg" $version $label -}}
|
||||
{{- $pathTemplate := cond .Site.IsMultiLingual (printf "svg/version/%%s-%%s.%s.svg" .Page.Language.Lang) "svg/version/%s-%s.svg" -}}
|
||||
{{- $path := printf $pathTemplate $version $type -}}
|
||||
{{- $res := resources.Get "svg/version.template.svg" -}}
|
||||
{{- $res = $res | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color) | minify -}}
|
||||
{{- $alt := printf "LoveIt %s | %s" $label $version -}}
|
||||
|
||||
Reference in New Issue
Block a user