{{ $staticDirs := slice "portfolio/toronto-motorcross" "portfolio/maternity" "bts/vd2024" "bts/vd2025" "bts/cantsay" }}
{{ $allImages := slice }}
{{ range $staticDirs }}
{{ $dir := . }}
{{ if (fileExists (printf "static/%s" .)) }}
{{ range (readDir (printf "static/%s" .)) }}
{{ if and (not .IsDir) (or (strings.HasSuffix (lower .Name) ".jpg") (strings.HasSuffix (lower .Name) ".jpeg") (strings.HasSuffix (lower .Name) ".webp") (strings.HasSuffix (lower .Name) ".png")) }}
{{ if and (ne .Name "cover.webp") (ne .Name "cover.jpg") (ne .Name ".DS_Store") (ne .Name "poster.jpg") (ne .Name "thumb.jpg") }}
{{ $allImages = $allImages | append (dict "dir" $dir "name" .Name) }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ $galleryPath := "static/images/gallery" }}
{{ if (fileExists $galleryPath) }}
{{ range (readDir $galleryPath) }}
{{ if .IsDir }}
{{ $dir := .Name }}
{{ range (readDir (printf "%s/%s" $galleryPath $dir)) }}
{{ if and (not .IsDir) (or (strings.HasSuffix (lower .Name) ".jpg") (strings.HasSuffix (lower .Name) ".jpeg") (strings.HasSuffix (lower .Name) ".webp") (strings.HasSuffix (lower .Name) ".png")) }}
{{ if and (ne .Name "cover.webp") (ne .Name "cover.jpg") (ne .Name ".DS_Store") (ne .Name "poster.jpg") (ne .Name "thumb.jpg") }}
{{ $allImages = $allImages | append (dict "dir" (printf "images/gallery/%s" $dir) "name" .Name) }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ $shuffledOnce := shuffle $allImages }}
{{ $shuffledTwice := shuffle $shuffledOnce }}
{{ range $index := (seq 5) }}
{{ $frameImages := shuffle $shuffledTwice }}
{{ $frameImages = first 6 $frameImages }}
{{ range $imgIndex, $image := $frameImages }}

{{ end }}
{{ end }}