{{/* Available notice types: danger, warning, caution, info, note, tip */}} {{- $noticeType := "note" -}} {{- if len .Params | eq 0 -}} {{- $noticeType = .noticeType | default "note" -}} {{- else -}} {{- $noticeType = .Get 0 | default "note" -}} {{- end -}} {{/* Workaround markdownify inconsistency for single/multiple paragraphs */}} {{- $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 -}} {{/* Load the css if it's the first time */}} {{- if not ($.Page.Scratch.Get "notice-style-loaded-flag") -}} {{- $.Page.Scratch.Set "notice-style-loaded-flag" true -}} {{- end -}}
{{ printf "icons/%s.svg" $noticeType | readFile | safeHTML }} {{- i18n $noticeType -}}
{{- if or $block (not $raw) }}{{ $raw }}{{ else }}{{ $raw }}
{{ end -}}