{{ $_hugo_config := `{ "version": 1 }` }} {{ $style := .Get "style" | default "neutral" }} {{ $title := .Get "title" | default ("Attachments-label" | T) }}
{{ $title }}
{{if eq .Page.File.BaseFileName "index"}} {{$.Scratch.Add "filesName" "files"}} {{else}} {{$.Scratch.Add "filesName" (printf "%s.files" .Page.File.BaseFileName)}} {{end}}
{{ range (readDir (printf "./content/%s%s" .Page.File.Dir ($.Scratch.Get "filesName")) ) }} {{ $fileDir := replace $.Page.File.Dir "\\" "/" }} {{if ($.Get "pattern")}} {{if (findRE ($.Get "pattern") .Name)}}
  • {{.Name}} ({{div .Size 1024 }} {{T "BinaryPrefix-kilobyte"}})
  • {{end}} {{else}}
  • {{.Name}} ({{div .Size 1024 }} {{T "BinaryPrefix-kilobyte"}})
  • {{end}} {{end}}
    {{.Inner}}