I created two ways of retrieving the first image in the following front matter of the author (index.md):
images:
- “/authors/alfred/alfred.gif”
- “/authors/alfred/study.jpg”
in layouts/_default/single.html I have the following:
{{- with .Params.author }}
{{- range where $.Site.RegularPages “Params.name” . }}
{{ index .Params.images 0 }} <- this gives the error
{{range $i,$v := .Params.images }}
{{ if not i }}
{{ .Scratch.Set “photo” v }}
{{end}}
{{end}}
{{.Scratch.Get “photo” }} <- this gives the image for me to use
{{- end }}{{ end }}
why does the index function generate an error?