{{$path := .}} {{- $filepaths := slice -}} {{range (readDir $path) }} {{if .IsDir}} {{ partial "hugo-sundries/recursive-readdir.html" (path.Join $path .Name) }} {{ else }} {{- $filepaths = $filepaths | append (path.Join $path .Name) -}} {{end}} {{end}} {{ return $filepaths }}