2020-02-17 14:31:53 +01:00
|
|
|
{{- $type := index . "type" | default "fa" -}}
|
|
|
|
{{- $classList := split (index . "class") " " -}}
|
|
|
|
{{- $scratch := index . "scratch" -}}
|
2020-02-17 14:02:27 +01:00
|
|
|
{{- /* 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 -}}
|
2020-02-17 14:31:53 +01:00
|
|
|
<i class="{{ delimit $classList ` ` }}"></i>
|
2020-02-17 14:02:27 +01:00
|
|
|
{{- $scratch.Set "iconfont" true -}}
|
|
|
|
{{- end -}}
|