summaryrefslogtreecommitdiffstats
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/shortcodes/callout.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/layouts/shortcodes/callout.html b/layouts/shortcodes/callout.html
new file mode 100644
index 0000000..b492267
--- /dev/null
+++ b/layouts/shortcodes/callout.html
@@ -0,0 +1,15 @@
+{{- $type := .Get "type" | default "note" -}}
+{{- $title := .Get "title" | default (i18n (printf "callout_%s" $type)) -}}
+{{- $role := cond (eq $type "danger") "alert" "note" -}}
+{{- $icons := dict "note" "edit-2" "tip" "zap" "info" "info" "warning" "alert-triangle" "danger" "x-circle" "success" "check-circle" -}}
+{{- $icon := index $icons $type | default "info" -}}
+
+<div class="callout callout-{{ $type }}" role="{{ $role }}">
+ <div class="callout-title">
+ <i data-feather="{{ $icon }}" class="w-3.5 h-3.5" aria-hidden="true"></i>
+ <span>{{ $title }}</span>
+ </div>
+ <div class="callout-body">
+ {{- .Inner | markdownify -}}
+ </div>
+</div>