List files in a directory

That blob @ju52 provided seemed promising but I couldn’t wrap my brain around it. I’m also very new to hugo, so doing anything confuses me.

I ended up coming up with this blob that might serve as a more basic starting point:

$ cat layouts/shortcodes/reportlist.html 
{{ $path := .Get "path" }}{{ $files := readDir $path }}
<ul class="reportlist">{{ range sort $files ".Name" "desc" }}{{ if not .IsDir }}{{ if ne .Name "index.md" }}
<li><a class="reportitem" href="/{{ replace $path "content/" ""}}{{ .Name }}">{{ .Name }}</a></li>
{{ end }}{{ end }}{{ end }}</ul>

Used with:

$ grep reportlist district_5/index.md 
{{< reportlist path="content/treasury/district_5/" >}}