layouts/shortcodes/blockquote.html (29 lines of code) (raw):

{{- $raw := (markdownify .Inner | chomp) -}} {{- $block := findRE "(?is)^<(?:address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h(?:1|2|3|4|5|6)|header|hgroup|hr|li|main|nav|noscript|ol|output|p|pre|section|table|tfoot|ul|video)\\b" $raw 1 -}} {{- $blockType := .Get 0 | default "info" -}} {{ $icon := "💡" }} {{ $title := .Get 1 | default "NOTE" }} {{ if (eq $blockType "warning") }} {{ $icon = "⚠" }} {{ $title = .Get 1 | default "WARNING" }} {{ end }} {{ if (eq $blockType "important") }} {{ $icon = "❗" }} {{ $title = .Get 1 | default "IMPORTANT" }} {{ end }} <style> blockquote.warning { border-color: #b91900 !important; } blockquote.important { border-color: #e7c416 !important; } </style> <blockquote class="{{ $blockType }}"> <p class="quote-title">{{ $icon }} <strong>{{ $title }}</strong></p> {{- if or $block (not $raw) }} {{ $raw }} {{ else }} <p>{{ $raw }}</p> {{ end -}} </blockquote>