www/themes/LoveIt/layouts/partials/plugin/icon.html
2020-05-28 14:55:57 +02:00

17 Zeilen
553 B
HTML

{{- with .class -}}
<i class="{{ . }}"></i>
{{- else -}}
{{- $src := .src -}}
{{- with .simpleicons -}}
{{- $prefix := "lib/simple-icons/icons" -}}
{{- with $.prefix -}}
{{- $prefix = . -}}
{{- end -}}
{{- $prefix = $prefix | strings.TrimSuffix "/" -}}
{{- $src = printf "%v/%v.svg" $prefix . -}}
{{- end -}}
{{- if (urls.Parse $src).Host | not -}}
{{- $src = (resources.Get $src | minify).RelPermalink -}}
{{- end -}}
<i data-svg-src="{{ $src }}"></i>
{{- end -}}