{{ .Title }}
{{ $img := newScratch }} {{ $folder := (print "/content/" .File.Dir "gallery/") }} {{ $files := readDir $folder }} {{ range sort $files "Name" "asc" }} {{ if not .IsDir }} {{ $img.Add "list" (slice .Name) }} {{ 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") }}
{{ .Content }}
{{ partial "article-footer.html" . }}