mirror of
https://github.com/gethinode/hinode.git
synced 2025-10-18 07:23:09 +00:00
31 lines
987 B
HTML
31 lines
987 B
HTML
{{/* Adapted from https://gohugo.io/render-hooks/blockquotes/#alerts */}}
|
|
|
|
{{ $icons := dict
|
|
"caution" "fa hand"
|
|
"important" "fas exclamation"
|
|
"note" "fas circle-info"
|
|
"tip" "fa lightbulb"
|
|
"warning" "fas triangle-exclamation"
|
|
}}
|
|
|
|
{{ if eq .Type "alert" }}
|
|
{{ $alert := .AlertType }}
|
|
{{ $icon := (index $icons $alert) }}
|
|
|
|
<blockquote class="blockquote-alert blockquote-alert-{{ $alert }}">
|
|
<p class="blockquote-alert-heading">
|
|
{{ with $icon }}
|
|
{{ partial "assets/icon.html" (dict "icon" (printf "%s fa-fw" .)) }}
|
|
{{ or (i18n $alert) (title $alert) }}
|
|
{{ else }}
|
|
{{ title $alert }}
|
|
{{ warnf "Unsupported alert type: '%s'. See %s" $alert $.Position }}
|
|
{{ end }}
|
|
</p>
|
|
{{ trim .Text "\n\r" | safeHTML }}
|
|
</blockquote>
|
|
{{ else }}
|
|
<blockquote class="blockquote">
|
|
{{ trim .Text "\n\r" | safeHTML }}
|
|
</blockquote>
|
|
{{ end }} |