{{- $error := false -}} {{- $title := .Get "title" | default "" -}} {{- $class := .Get "class" | default "" -}} {{- $color := "secondary" -}} {{- with .Get "color" }}{{ $color = . }}{{ end -}} {{- $supportedColors := slice "primary" "secondary" "success" "danger" "warning" "info" "light" "dark" "white" "black" -}} {{- if not (in $supportedColors $color) -}} {{- errorf "Invalid value for param 'color': %s" .Position -}} {{- end -}} {{- if not $title }} {{ errorf "Missing title: %s" .Position -}} {{ else -}} {{ $title | plainify }} {{ end -}}