2024-08-29 00:17:05 +02:00
|
|
|
{{- $size := (or .size "88x31") -}}
|
|
|
|
{{- $sizes := (split $size "x") -}}
|
|
|
|
{{- $alt := (or (and .alt (printf "[%s]" .alt)) "") -}}
|
|
|
|
{{- $src := (or
|
|
|
|
.src
|
|
|
|
(printf `%s/Media/Buttons/%s/%s`
|
|
|
|
(partial "assetsRoot.html")
|
|
|
|
$size
|
|
|
|
.srcRelative)) -}}
|
|
|
|
{{- $style := (or .style "") -}}
|
|
|
|
{{- if (and (not $style) (not (eq (index (last 1 (split $src ".")) 0) "svg"))) -}}
|
|
|
|
{{- $style = "image-rendering: pixelated;" -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{/* TODO: maybe set rendering via a class instead of inline CSS? */}}
|
|
|
|
{{- $img := (printf `<img src="%s" style="%s" alt="%s" title="%s" width="%spx" height="%spx" />`
|
|
|
|
$src $style
|
|
|
|
$alt $alt
|
|
|
|
(index $sizes 0) (index $sizes 1)
|
|
|
|
) | safeHTML -}}
|
2024-08-29 00:35:27 +02:00
|
|
|
{{ if .href }}
|
2024-08-29 00:17:05 +02:00
|
|
|
{{ partial "anchor.html" (dict
|
|
|
|
"Inner" $img
|
|
|
|
"Params" .) }}
|
2024-08-29 00:35:27 +02:00
|
|
|
{{ else }}
|
2024-08-29 00:17:05 +02:00
|
|
|
{{ $img }}
|
2024-08-29 00:35:27 +02:00
|
|
|
{{ end }}
|