{{ $pic_set := .pic_set }} {{ $caption := .caption }} {{ $num_per_row := 3}} {{ $max_width := 80}} {{ if or (eq (len .pic_set) 2) (eq (len .pic_set) 4)}} {{ $num_per_row = 2}} {{ $max_width = 53}} {{ end }} {{/* Trim the caption length to the first 100 characters */}} {{ $caption = $caption | truncate 100 "..." }}
{{ range $num, $a := $pic_set }} {{ if resources.Get $a }} {{ $a = (resources.Get $a).RelPermalink }} {{ end }} {{ $display := "block"}} {{ if gt $num 8 }} {{ $display = "none"}} {{ end }}
{{ if and (eq $num 8) (gt (len $pic_set) 9) }} {{ else }} {{ end }}
{{ end }}