LoveIt/layouts/partials/plugin/icon.html

25 lines
855 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 -}}
{{- dict "forkawesome" true | merge (.Get "this") | .Set "this" -}}
{{- 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 -}}
{{- dict "iconfont" true | merge (.Get "this") | .Set "this" -}}
{{- end -}}
{{- end -}}
<i class="{{ delimit $classList ` ` }}"></i>