mirror of
https://gitlab.com/octtspacc/sitoctt
synced 2025-02-18 04:20:50 +01:00
38 lines
1.4 KiB
HTML
38 lines
1.4 KiB
HTML
{{- $extended := (eq .Params.extended true) -}}
|
|
{{- $context := . -}}
|
|
{{- $language := (string .Site.Language) -}}
|
|
{{- with resources.Get "ButtonBadges.toml" -}}
|
|
{{- with . | transform.Unmarshal -}}
|
|
{{- range $group, $badges := . -}}
|
|
<div data-group="{{ $group }}">
|
|
{{- if $extended -}}<ul>{{- end -}}
|
|
{{- range $badges -}}
|
|
{{- $src := .src -}}
|
|
{{- if (or .file .src) -}}
|
|
{{- if $src -}}
|
|
{{- $src = (partial "functions/ParseFileUrl.html" $src) -}}
|
|
{{- end -}}
|
|
{{- $newprops := (dict
|
|
"decoding" "async"
|
|
"src" $src
|
|
"srcRelative" .file
|
|
"hrefLinkback" .linkback
|
|
) -}}
|
|
{{- if .spam -}}
|
|
{{- $newprops = (merge $newprops (dict
|
|
"rel" "nofollow noopener"
|
|
"target" "_blank")) -}}
|
|
{{- end -}}
|
|
{{ partial "ImgButton.html" (merge . $newprops (dict "Context" $context)) }}
|
|
{{- else -}}
|
|
{{- if $extended -}}</ul>{{- end -}}
|
|
<h4>{{ partial "functions/FromLanguageObject.html" (dict "Object" .title "Language" $language) }}</h4>
|
|
{{- if $extended -}}<ul>{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- if $extended -}}</ul>{{- end -}}
|
|
</div>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end -}}
|