From 4b79d3615520cf3b0f72495ec6886682a576085f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Sun, 29 May 2022 10:04:06 +0200 Subject: [PATCH] attachments: streamline icon parameter with button shortcode #240 --- layouts/shortcodes/attachments.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/layouts/shortcodes/attachments.html b/layouts/shortcodes/attachments.html index b4ba313bf9..358c4f8881 100644 --- a/layouts/shortcodes/attachments.html +++ b/layouts/shortcodes/attachments.html @@ -7,13 +7,16 @@ {{- if eq $style "info" }}{{ $icon = default "info-circle" }}{{ end }} {{- if eq $style "warning" }}{{ $icon = default "exclamation-triangle" }}{{ end }} {{- if eq $style "note" }}{{ $icon = default "exclamation-circle" }}{{ end }} - {{- if eq $style "tip" }}{{ $icon = default "lightbulb " }}{{ end }} + {{- if eq $style "tip" }}{{ $icon = default "lightbulb" }}{{ end }} {{- end }} {{- $icon = trim $icon " " }} +{{- if and $icon (not (findRE ".*?\\bfa-\\w.*?" $icon)) }} + {{- $icon = printf "fa-fw fas fa-%s" $icon }} +{{- end }} {{- $sort := .Get "sort" | default "asc" }} {{- $pattern := .Get "pattern" | default "" }} -
-
{{ if $icon }} {{ end }}{{ $title }}
+
+
{{ if $icon }} {{ end }}{{ $title }}
    {{- $filesName := "files" }} {{- if ne .Page.File.BaseFileName "index" }}