{{ $color := "primary" -}} {{ 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 -}} {{ $color = "primary" -}} {{ end -}} {{ $growParam := "false" -}} {{ $grow := false -}} {{ with .Get "grow" }}{{ $growParam = . }}{{ end -}} {{ $supportedFlags := slice "true" "false" -}} {{ if in $supportedFlags $growParam -}} {{ if eq $growParam "true" }}{{ $grow = true }}{{ end -}} {{ else -}} {{ errorf "Invalid value for param 'grow': %s" .Position -}} {{ end -}} {{ $class := "" -}} {{ with .Get "class" }}{{ $class = . }}{{ end -}} {{ with $class }}