{{ $error := false }} {{ if partial "utilities/IsInvalidArgs.html" (dict "structure" "release" "args" .Params) }} {{ errorf "Invalid arguments: %s" .Position -}} {{ $error = true }} {{ end }} {{- $version := .Get "version" | default "" -}} {{- $state := .Get "state" | default "new" -}} {{- $short := false -}} {{ with .Get "short" }}{{ $short = partial "utilities/CastBool.html" . }}{{ end -}} {{- $inline := false -}} {{ with .Get "inline" }}{{ $inline = partial "utilities/CastBool.html" . }}{{ end -}} {{- $title := $version -}} {{- $color := "primary" -}} {{- if eq $state "deprecated" -}} {{- $color = "secondary" -}} {{- end -}} {{- $size := .Get "size" | default "md" -}} {{- $class := .Get "class" | default "" -}} {{- $icon := "" -}} {{- $tooltip := "" -}} {{- if eq $state "deprecated" -}} {{- if $short -}} {{- $icon = "fas trash-can" -}} {{- $tooltip = T "deprecatedFeature" $version -}} {{ else }} {{- $title = T "deprecatedFeature" $version -}} {{- end -}} {{- else -}} {{- if $short -}} {{- $icon = "fas rocket" -}} {{- $tooltip = T "addedFeature" $version -}} {{ else }} {{- $title = T "addedFeature" $version -}} {{- end -}} {{- end -}} {{- if not $short -}} {{- if eq $state "deprecated" -}} {{- $title = T "deprecatedFeature" $version -}} {{- else -}} {{- $title = T "addedFeature" $version -}} {{- end -}} {{- end -}} {{- if not $error -}} {{- if not $inline }}
{{ end -}} {{- partial "assets/button.html" (dict "title" $title "href" (partial "partials/utilities/URLJoin.html" (dict "base" site.Params.docs.release "path" $version)) "size" "sm" "color" $color "outline" "true" "size" $size "icon" $icon "tooltip" $tooltip "order" "first" "class" (trim (printf "rounded-2 fw-semibold %s" $class) " ") "spacing" $inline) -}} {{- if not $inline }}
{{ end -}} {{- end -}}