{{ $path := $.Page.Dir }} {{ $filePath := printf "content/%s" ($path) }} {{ $withCaptions := .Get "withCaptions"}} {{ $gallery := .Get "id" }} {{ range readDir ($filePath) }} {{ $display := strings.HasSuffix .Name "pdf" }} {{ $caption := substr .Name 0 128 }} {{ if $display}}
{{ $caption}}
{{ end }} {{ end }}