From 6710d8ca0faacc216f6b0ded11d8ddbdfea4cbd8 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Tue, 23 Sep 2025 10:54:18 +0800 Subject: feat: add alert blockquote support The syntax below is now supported: > [!alertType] > content This was meant to replace {{< callout >}} shortcode Former-commit-id: 4ff967a9f1a2f26bbf13a9d4c2dd1a9a252582fd --- assets/css/_markdown.scss | 13 ------------- layouts/_markup/render-blockquote.html | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 13 deletions(-) create mode 100644 layouts/_markup/render-blockquote.html diff --git a/assets/css/_markdown.scss b/assets/css/_markdown.scss index bb30f455..31ee8f5a 100644 --- a/assets/css/_markdown.scss +++ b/assets/css/_markdown.scss @@ -34,19 +34,6 @@ $em-text-color: #889E73; } } - blockquote { - color: var(--secondary-text-color); - padding: 0; - margin: 0; - &:not(blockquote > blockquote) { - margin-left: 1em; - } - & > blockquote { - border-left: 2px solid $border-color; - padding-left: 1em; - } - } - code { font-size: 90%; color: var(--secondary-text-color); 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" }} +
+
+ {{ index $emojis .AlertType }} +
+
+ {{ with .AlertTitle }} +

{{ . }}

+ {{ end }} + {{ .Text }} +
+
+{{ else }} +
+ {{ .Text }} +
+{{ end }} -- cgit v1.2.3