LoveIt/layouts/partials/plugin/icon.html
Dillon f14301c395
feat: improve configuration (#245)
* feat: improve configuration

* fix: fix partials/footer.html error
2020-04-21 22:55:06 +08:00

25 lines
No EOL
855 B
HTML

{{- $type := .type | default "fa" -}}
{{- $classList := split .class " " -}}
{{- /* Fork Awesome */ -}}
{{- 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 -}}
{{- $classList = $newClassList -}}
{{- with .scratch -}}
{{- dict "forkawesome" true | merge (.Get "this") | .Set "this" -}}
{{- end -}}
{{- /* default is Font Awesome */ -}}
{{- /* Others */ -}}
{{- else if ne $type "fa" -}}
{{- with .scratch -}}
{{- dict "iconfont" true | merge (.Get "this") | .Set "this" -}}
{{- end -}}
{{- end -}}
<i class="{{ delimit $classList ` ` }}"></i>