LoveIt/layouts/partials/plugin/icon.html

23 lines
766 B
HTML
Raw Normal View History

{{- $type := index . "type" | default "fa" -}}
{{- $classList := split (index . "class") " " -}}
{{- $scratch := index . "scratch" -}}
{{- /* Fork Awesome */ -}}
2020-02-21 16:42:35 +01:00
{{- if eq $type "fo" -}}
{{- $newClassList := slice -}}
{{- range $classList -}}
{{- if eq . "fa" -}}
{{- $newClassList = $newClassList | append "fo" -}}
{{- else -}}
{{- $newClassList = $newClassList | append (replaceRE `^fa\-(.+)$` `fo-$1` .) -}}
{{- end -}}
{{- end -}}
2020-02-21 16:42:35 +01:00
{{- $classList = $newClassList -}}
{{- $scratch.Set "forkawesome" true -}}
2020-02-21 16:42:35 +01:00
{{- /* default is Font Awesome */ -}}
{{- /* Others */ -}}
2020-02-21 16:42:35 +01:00
{{- else if ne $type "fa" -}}
{{- $scratch.Set "iconfont" true -}}
{{- end -}}
2020-02-21 16:42:35 +01:00
<i class="{{ delimit $classList ` ` }}"></i>