{{ $base := .Get "src" }}
{{ $path := print "static/" (.Get "src") }}
{{ $galleryName := default "gallery" (.Get "galleryName") }}
{{ range (readDir $path) }}
{{- $thumbext := "-thumb" }}
{{- $isthumb := .Name | findRE ($thumbext | printf "%s\\.") }}
{{- $isimg := lower .Name | findRE "\\.(gif|jpg|jpeg|tiff|png|bmp)" }}
{{- if and $isimg (not $isthumb) }}
{{- $thumb := .Name | replaceRE "(\\.[^.]+)" ($thumbext | printf "%s.jpg") }}
{{- $alttextfile := .Name | replaceRE "(\\..+)" ".md" }}
{{- $alttext := printf "%s/%s" $path $alttextfile | os.ReadFile }}
{{- end }}
{{ end }}