summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-09-23 10:54:18 +0800
committerEltrac <hi@guhub.cn>2025-09-23 10:54:18 +0800
commit6710d8ca0faacc216f6b0ded11d8ddbdfea4cbd8 (patch)
treed4bc39d2c6040770e4fd70ab343dab9c58131176 /layouts
parent85ac3f54375f0292b65614af61d2326ab38335bc (diff)
feat: add alert blockquote support
The syntax below is now supported: > [!alertType] > content This was meant to replace {{< callout >}} shortcode Former-commit-id: 4ff967a9f1a2f26bbf13a9d4c2dd1a9a252582fd
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_markup/render-blockquote.html28
1 files changed, 28 insertions, 0 deletions
diff --git a/layouts/_markup/render-blockquote.html b/layouts/_markup/render-blockquote.html
new file mode 100644
index 00000000..6295663e
--- /dev/null
+++ b/layouts/_markup/render-blockquote.html
@@ -0,0 +1,28 @@
+{{ $emojis := dict
+ "caution" "🚨"
+ "important" "â˜ī¸"
+ "note" "â„šī¸"
+ "tip" "💡"
+ "warning" "âš ī¸"
+}}
+
+{{ if eq .Type "alert" }}
+ <blockquote class="rounded-1 leading-[1.75] mx-0 px-5
+ flex gap-3 my-2 alert-{{ .AlertType }}"
+ style="background-color: rgba(var(--block-background-color-rgb), 0.5)"
+ >
+ <div class="py-5">
+ {{ index $emojis .AlertType }}
+ </div>
+ <div>
+ {{ with .AlertTitle }}
+ <h4 class="mt-5 -mb-5 font-extrabold text-inherit">{{ . }}</h4>
+ {{ end }}
+ {{ .Text }}
+ </div>
+ </blockquote>
+{{ else }}
+ <blockquote class="text-secondary p-0 m-0 ml-[1em]">
+ {{ .Text }}
+ </blockquote>
+{{ end }}