{{ define "main" }} <!-- HTML for Photos view here --> {{- $list := where .Pages ".Params.photos" "!=" nil -}} {{- $len := (len $list) -}} {{ range $index, $value := $list }} <!-- Loop through each post happens here --> <!-- HTML for each item here --> {{ range first 1 .Params.photos }} <!-- HTML for the first image here, example given --> <a href="{{ .Permalink }}" title="{{ .Title }}"><img src="{{ . }}"></img></a> {{ end }} {{ end }} <!-- More HTML for Photos view --> {{ end }}