forked from ruangrupa/lumbung.space
page resources are returned in reverse, so get the last image rather than the first
This commit is contained in:
parent
856ff9851e
commit
a722904938
@ -19,7 +19,8 @@
|
|||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{ else if (.Resources.ByType "image") }}
|
{{ 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 := . }}
|
{{ $img := . }}
|
||||||
{{ $height := add .Height 0.0}}
|
{{ $height := add .Height 0.0}}
|
||||||
{{ $ratio := div $height .Width}}
|
{{ $ratio := div $height .Width}}
|
||||||
|
Loading…
Reference in New Issue
Block a user