blowfish/layouts/partials/hero/big.html
Wolf Noble 8cf476e37e
Update big.html to tolerate svgs
Turns out you can't specify width/height with vectors... odd
2023-08-25 20:17:24 -05:00

22 lines
1 KiB
HTML

{{ $disableImageOptimization := .Page.Site.Params.disableImageOptimization | default false }}
{{- $images := .Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- $alt := .Page.Title -}}
{{- with .Page.Params.alt }}{{ $alt = . }}{{ end -}}
{{- with $featured -}}
{{ if eq .MediaType.SubType "svg" }}
{{ with . }}
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" src="{{ .RelPermalink }}">
{{ end }}
{{ else if $disableImageOptimization }}
{{ with . }}
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
{{ end }}
{{ else }}
{{ with .Resize "1200x" }}
<img class="w-full rounded-lg single_hero_round nozoom" alt="{{ $alt }}" width="{{ .Width }}" height="{{ .Height }}" src="{{ .RelPermalink }}">
{{ end }}
{{ end }}
{{- end -}}