{{/* Built on hugo-notice by Nicolas Martignoni: https://github.com/martignoni/hugo-notice */}} {{/* Available notice types: warning, info, note, tip */}} {{- $noticeType := .Get 0 | default "note" -}} {{/* 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 -}} {{/* Count how many times we've called this shortcode and load the css if it's the first time */}} {{- if not ($.Page.Scratch.Get "noticecount") -}}
{{- end -}} {{- $.Page.Scratch.Add "noticecount" 1 -}}{{ if len .Params | eq 2 }}{{ .Get 1 }}{{ end }}
{{- if or $block (not $raw) }}{{ $raw }}{{ else }}{{ $raw }}
{{ end -}}