mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-15 03:16:30 +01:00
24 lines
836 B
HTML
24 lines
836 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 -}}
|
||
|
<span class="{{ delimit $classList ` ` }}"></span>
|
||
|
{{- $scratch.Set "iconfont" true -}}
|
||
|
{{- end -}}
|