mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-05 14:14:41 +00:00
See https://discord.com/channels/722225264733716590/738924091511144489/1406144559188283494 See https://gohugo.io/templates/new-templatesystem-overview/
25 lines
873 B
HTML
25 lines
873 B
HTML
{{/*
|
|
Docs: https://docs.hugoblox.com/content/writing-markdown-latex/#inline-image
|
|
|
|
Parameters
|
|
----------
|
|
name :
|
|
Icon name.
|
|
pack : default "fas"
|
|
Icon pack.
|
|
padding_left : default "0"
|
|
Left padding.
|
|
padding_right : default "1"
|
|
Right padding.
|
|
*/}}
|
|
|
|
{{- if (.Get "name") -}}
|
|
{{- $icon := .Get "name" -}}
|
|
{{- $pack := or (.Get "pack") "fas" -}}
|
|
{{- $pack_prefix := $pack -}}
|
|
{{- if in (slice "fab" "fas" "far" "fal") $pack -}}
|
|
{{- $pack_prefix = "fa" -}}
|
|
{{- end -}}
|
|
{{- $padding_right := (.Get "padding_right") | default 1 -}}{{/* Defaulting to 1 prevents no spacing when minimizing HTML. */}}
|
|
<i class="{{ $pack }} {{ $pack_prefix }}-{{ $icon }} {{with (.Get "padding_left")}}pl-{{.}}{{end}} {{with $padding_right}}pr-{{.}}{{end}} {{if ne (.Get "fixed_width") "false"}}fa-fw{{end}}"></i>
|
|
{{- end -}} |