diff --git a/layouts/shortcodes/alert.html b/layouts/shortcodes/alert.html index ef343828..cae61671 100644 --- a/layouts/shortcodes/alert.html +++ b/layouts/shortcodes/alert.html @@ -1,27 +1,42 @@ -{{ $icon := default "triangle-exclamation" (.Get "icon") }} -{{ $cardColor := default "NULL" (.Get "cardColor") }} -{{ $iconColor := default "NULL" (.Get "iconColor") }} -{{ $textColor := default "NULL" (.Get "textColor") }} - -{{ if eq $cardColor "NULL" }} -
+{{ if .IsNamedParams }} + {{ $.Scratch.Set "icon" (default "triangle-exclamation" (.Get "icon") ) }} + {{ $.Scratch.Set "cardColor" (default "NULL" (.Get "cardColor") ) }} + {{ $.Scratch.Set "iconColor" (default "NULL" (.Get "iconColor") ) }} + {{ $.Scratch.Set "textColor" (default "NULL" (.Get "textColor") ) }} {{ else }} -
+ {{ $.Scratch.Set "icon" (default "triangle-exclamation" (.Get 0) ) }} + {{ $.Scratch.Set "cardColor" "NULL" }} + {{ $.Scratch.Set "iconColor" "NULL" }} + {{ $.Scratch.Set "textColor" "NULL" }} {{ end }} - {{ if eq $iconColor "NULL" }} - + +
- {{ end }} - {{ partial "icon.html" $icon }} + class="flex px-4 py-3 rounded-md" + style="background-color: {{ $.Scratch.Get "cardColor" }}" + {{ end }}> + + + + {{ partial "icon.html" ($.Scratch.Get "icon") }} - {{ if eq $textColor "NULL" }} - - {{ else }} - - {{ end }} + + {{- .Inner | markdownify -}}