cullmann.io/themes/CodeIT/layouts/partials/plugin/icon.html

14 lines
456 B
HTML
Raw Normal View History

2021-02-18 21:44:01 +01:00
{{- with .Class -}}
<i class="{{ . }}"></i>
{{- else -}}
{{- $src := .Src -}}
{{- with .Simpleicons -}}
{{- $prefix := $.Prefix | default "lib/simple-icons/icons" | 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 -}}