LoveIt/layouts/partials/plugin/icon.html
Dillon c2197b7411
feat(social): improve social links (#254)
* replace forkawesome and iconfont with simple icons
* add more configs for social
2020-04-24 19:04:37 +08:00

17 lines
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 "%s/%s.svg" $prefix . -}}
{{- end -}}
{{- if (urls.Parse $src).Host | not -}}
{{- $src = (resources.Get $src | minify).RelPermalink -}}
{{- end -}}
<i data-svg-src="{{ $src }}"></i>
{{- end -}}