feat: default to fixed width icons with icon shortcode

This commit is contained in:
George Cushen 2020-01-26 00:52:40 +00:00
commit 2f00beab89
2 changed files with 4 additions and 3 deletions

View file

@ -57,8 +57,8 @@
sri = "sha256-pB/deHc9CGfFpJRjC43imB29Rse8tak+5eXqntO94ck="
url = "https://cdnjs.cloudflare.com/ajax/libs/anchor-js/%s/anchor.min.js"
[js.mermaid]
version = "8.4.3"
sri = "" # SRI unavailable.
version = "8.4.4"
sri = "sha256-JEqEejGt4tR35L0a1zodzsV0/PJ6GIf7J4yDtywdrH8="
url = "https://cdnjs.cloudflare.com/ajax/libs/mermaid/%s/mermaid.min.js"
[js.lazysizes]
version = "5.1.2"

View file

@ -5,5 +5,6 @@
{{- if in (slice "fab" "fas" "far" "fal") $pack -}}
{{- $pack_prefix = "fa" -}}
{{- end -}}
<i class="{{ $pack }} {{ $pack_prefix }}-{{ $icon }} {{with (.Get "padding_left")}}pl-{{.}}{{end}} {{with (.Get "padding_right")}}pr-{{.}}{{end}}"></i>
{{- $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 -}}