Hey, Iβm new to this language. How can I limit this to only the first string ($image) in the array ($images)? I have tried adding first 1
in different ways, but it is not working for me. Many thanks for help!
This works but shows all images from array:
{{ if isset .Params "images" }}
{{ range $images := .Params.images }}
{{ $image := resources.Get $images }}
{{with $image }}
<img src="{{ ($image.Resize "900x").RelPermalink }}">
{{ end }}
{{ end }}
{{ end }}
I have tried adding βfirst 1β for example here:
{{ if isset .Params "images" }}
{{ range first 1 $images := .Params.images }}
{{ $image := resources.Get $images }}
{{with $image }}
<img src="{{ ($image.Resize "900x").RelPermalink }}">
{{ end }}
{{ end }}
{{ end }}