page resources are returned in reverse, so get the last image rather than the first
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
rra 2024-11-24 12:03:07 +01:00
parent 856ff9851e
commit a722904938

View File

@ -19,7 +19,8 @@
</div>
{{end}}
{{ else if (.Resources.ByType "image") }}
{{ with (index (.Resources.ByType "image") 0) }}
{{/* Somehow the image resources are iterated in reverse, so we need to get the last one*/}}
{{ range last 1 (.Resources.ByType "image") }}
{{ $img := . }}
{{ $height := add .Height 0.0}}
{{ $ratio := div $height .Width}}