{{ $dir := (.Get "dir") }}
{{ with $dir }}
{{ $files := readDir (print "/static/" .) }}
{{ range $index, $file := $files }}
{{ $isimg := lower $file.Name | findRE "\\.(gif|jpg|jpeg|tiff|png|bmp|webp|avif|jxl)" }}
{{ if $isimg }}
{{ $linkURL := print $.Site.BaseURL "/" ($.Get "dir") "/" $file.Name | absURL }}
{{ if eq $index 0 }}
{{ else }}
{{ end }}
{{ end }}
{{ end }}
{{ range $index, $file := $files }}
{{ $isimg := lower $file.Name | findRE "\\.(gif|jpg|jpeg|tiff|png|bmp|webp|avif|jxl)" }}
{{ if $isimg }}
{{ $linkURL := print $.Site.BaseURL "/" ($.Get "dir") "/" $file.Name | absURL }}
{{ if eq $index 0 }}
{{ else }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}