{{- /* Notes in article. @param {string} (positional parameter 0) [tip|important|warning|info] @returns {template.HTML} @examples {{< alert "tip" >}} Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque in egestas lacus, sed faucibus augue. {{< /alert >}} */ -}} {{ $type := (.Get 0) }} {{ $types := (slice "important" "info" "tip" "warning") }} {{ 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 }} {{ $icon := "fas fa-sticky-note" }} {{ $css := "primary" }} {{ if (eq ($type) "info") }} {{ $icon = "fas fa-info" }} {{ $css = "info" }} {{ end }} {{ if (eq ($type) "important") }} {{ $icon = "fas fa-exclamation-triangle" }} {{ $css = "warning" }} {{ end }} {{ if (eq ($type) "tip") }} {{ $icon = "fas fa-lightbulb" }} {{ $css = "success" }} {{ end }} {{ if (eq ($type) "warning") }} {{ $icon = "fas fa-circle-radiation" }} {{ $css = "danger" }} {{ end }}