mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-25 16:26:36 +01:00
22 lines
766 B
HTML
22 lines
766 B
HTML
{{- $type := index . "type" | default "fa" -}}
|
|
{{- $classList := split (index . "class") " " -}}
|
|
{{- $scratch := index . "scratch" -}}
|
|
{{- /* 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 -}}
|
|
{{- $scratch.Set "forkawesome" true -}}
|
|
|
|
{{- /* default is Font Awesome */ -}}
|
|
{{- /* Others */ -}}
|
|
{{- else if ne $type "fa" -}}
|
|
{{- $scratch.Set "iconfont" true -}}
|
|
{{- end -}}
|
|
<i class="{{ delimit $classList ` ` }}"></i>
|