LoveIt/layouts/partials/plugin/icon.html

26 lines
784 B
HTML
Raw Normal View History

2020-02-27 13:14:40 +01:00
{{- $type := .type | default "fa" -}}
{{- $classList := split .class " " -}}
{{- /* 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 -}}
{{- with .scratch -}}
{{- .Set "forkawesome" true -}}
{{- end -}}
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" -}}
{{- with .scratch -}}
{{- .Set "iconfont" true -}}
{{- end -}}
{{- end -}}
2020-02-21 16:42:35 +01:00
<i class="{{ delimit $classList ` ` }}"></i>