mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-15 03:16:30 +01:00
23 lines
833 B
HTML
23 lines
833 B
HTML
{{- $type := index . "type" | default "fa" -}}
|
|
{{- $classList := split (index . "class") " " -}}
|
|
{{- $scratch := index . "scratch" -}}
|
|
{{- /* Font Awesome */ -}}
|
|
{{- if eq $type "fa" -}}
|
|
<i class="{{ delimit $classList ` ` }}"></i>
|
|
{{- /* Fork Awesome */ -}}
|
|
{{- else 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 -}}
|
|
<i class="{{ delimit $newClassList ` ` }}"></i>
|
|
{{- $scratch.Set "forkawesome" true -}}
|
|
{{- /* Others */ -}}
|
|
{{- else -}}
|
|
<i class="{{ delimit $classList ` ` }}"></i>
|
|
{{- $scratch.Set "iconfont" true -}}
|
|
{{- end -}}
|