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
|
|
|
{{- /* Fork Awesome */ -}}
|
2020-02-21 16:42:35 +01:00
|
|
|
{{- if eq $type "fo" -}}
|
2020-02-17 14:02:27 +01:00
|
|
|
{{- $newClassList := slice -}}
|
|
|
|
{{- range $classList -}}
|
|
|
|
{{- if eq . "fa" -}}
|
|
|
|
{{- $newClassList = $newClassList | append "fo" -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- $newClassList = $newClassList | append (replaceRE `^fa\-(.+)$` `fo-$1` .) -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- end -}}
|
2020-02-21 16:42:35 +01:00
|
|
|
{{- $classList = $newClassList -}}
|
2020-02-17 14:02:27 +01:00
|
|
|
{{- $scratch.Set "forkawesome" true -}}
|
2020-02-21 16:42:35 +01:00
|
|
|
|
|
|
|
{{- /* default is Font Awesome */ -}}
|
2020-02-17 14:02:27 +01:00
|
|
|
{{- /* Others */ -}}
|
2020-02-21 16:42:35 +01:00
|
|
|
{{- else if ne $type "fa" -}}
|
2020-02-17 14:02:27 +01:00
|
|
|
{{- $scratch.Set "iconfont" true -}}
|
|
|
|
{{- end -}}
|
2020-02-21 16:42:35 +01:00
|
|
|
<i class="{{ delimit $classList ` ` }}"></i>
|