{{ $gallery := ($.Page.Resources.Match "gallery/*").ByType "image" }} {{ range $gallery }} <a href="{{ .Permalink }}"> <img src="{{ (.Fill "300x300 q50").Permalink }}" alt="" /> </a> {{ end }}