Files
hextra_mirror/layouts/_default/_markup/render-blockquote-alert.html
2024-12-14 17:27:33 +00:00

21 lines
599 B
HTML

{{- $supportedAlertTypes := slice "note" "tip" "important" "warning" "caution" -}}
{{- $emojis := dict
"note" ":memo:"
"tip" ":bulb:"
"important" ":information_source:"
"warning" ":warning:"
"caution" ":exclamation:"
-}}
{{- if not (in $supportedAlertTypes .AlertType) -}}
<blockquote>
{{- .Text -}}
</blockquote>
{{- else -}}
{{- $emoji := emojify (index $emojis .AlertType) -}}
{{- $content := .Text -}}
{{- $icon := "" -}}
{{- $class := "" -}}
{{- partial "shortcodes/callout.html" (dict "content" $content "emoji" $emoji "icon" $icon "class" $class) -}}
{{- end -}}