{{- /* @param {string} (positional parameter 0) Spoiler title. @param {string} (positional parameter 1) Spoiler type. @returns {template.HTML} @examples {{< spb "Spoiler" "danger" >}} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus vehicula vel neque id vestibulum. Nulla cursus, nisl sed fermentum iaculis, urna arcu mollis mi, non fringilla turpis nisl vitae eros. {{< /spb >}} */ -}} {{ $title := ((.Get 0) | default (printf "Spoiler #%d" (.Ordinal))) }} {{ $type := ((.Get 1) | default "primary") }} {{ $types := (slice "primary" "secondary" "success" "danger" "warning" "info" "light" "dark") }} {{ with ($type) }} {{ if (not (in ($types) .)) }} {{ (errorf "The type passed to the %q shortcode is invalid. The type must be one of %s. See %s." ($.Name) (delimit ($types) ", " ", or ") ($.Position)) }} {{ end }} {{ end }} {{ $id := ((printf "sc-%s-%s" ($.Name) (delimit (shuffle (seq 11 99)) "")) | md5) }}

{{ ($title) }}

{{ with (.Inner) }}{{ (. | $.Page.RenderString (dict "display" "block")) }}{{ end }}