{{- $error := false -}} {{ $color := .Get "color" | default "" -}} {{ $supportedColors := slice "primary" "secondary" "success" "danger" "warning" "info" "light" "dark" -}} {{ if and $color (not (in $supportedColors $color)) -}} {{ errorf "Invalid value for param 'color': %s" .Position -}} {{ $error = true -}} {{ end -}} {{- $class := .Get "class" | default "" -}} {{- if $color }}{{ $class = printf "%s text-bg-%s" $class $color }}{{ end -}} {{- if not $error -}} {{ trim .Inner " \r\n" | .Page.RenderString -}} {{- end -}}