From 455ecae53d69f110287b4aae9d33ca40d47f5f1a Mon Sep 17 00:00:00 2001 From: Mircea-Pavel ANTON Date: Wed, 25 Jan 2023 13:34:35 +0000 Subject: [PATCH] Customize alert shortcode --- layouts/shortcodes/alert.html | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/layouts/shortcodes/alert.html b/layouts/shortcodes/alert.html index 190c08c5..ef343828 100644 --- a/layouts/shortcodes/alert.html +++ b/layouts/shortcodes/alert.html @@ -1,8 +1,27 @@ +{{ $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" }}
+{{ else }} +
+{{ end }} + + {{ if eq $iconColor "NULL" }} - {{ partial "icon.html" (.Get 0 | default "triangle-exclamation") }} + {{ else }} + + {{ end }} + {{ partial "icon.html" $icon }} + + {{ if eq $textColor "NULL" }} + {{ else }} + + {{ end }} {{- .Inner | markdownify -}}