diff --git a/layouts/archives/single.html b/layouts/archives/single.html index a219df3..596ca63 100644 --- a/layouts/archives/single.html +++ b/layouts/archives/single.html @@ -11,23 +11,28 @@ {{ $img := newScratch }} {{ $folder := (print "/content/" .File.Dir "gallery/") }} {{ $files := readDir $folder }} + {{ $img.Set "max" 0 }} {{ range sort $files "Name" "asc" }} {{ if not .IsDir }} - {{ $img.Add "list" (slice .Name) }} + {{ if not (in .Name "thumb") }} + {{ $img.Add "list" (slice .Name) }} + {{ $img.Set "max" (add ($img.Get "max") 1) }} + {{ end }} {{ end }} {{ end }} - {{ with ($img.Get "list") }} - {{ $img.Set "max" (add 1 (int (index (split (index (split (index (last 1 .) 0) ".") 0) "img") 1))) }} - {{ end }} {{ range $index, $val := $img.Get "list" }} {{ $curr := index (split $val ".") 0 }} {{ $prec := mod (add (sub $index 1) ($img.Get "max")) ($img.Get "max") }} {{ $next := mod (add $index 1) ($img.Get "max") }}
-