Hey there,
First, I cannot use Page Resource on this project
I need to output a tree structure of files with download link (grouped by directory)
Here is my dir structure from static or else:
βββ docs
βββ dir-1
β βββ a-file.pdf
β βββ another-file.xlm
βββ dir-2
β βββ a-file.pdf
β βββ another-file.xlm
βββ anoying_file.pdf
The template would look like this:
Something like this:
{{ $docs := readDir "content/docs" }}
{{ range $docs }}
{{ if .IsDirectory }}
{{ range . }}
{{ printf "%#v" . }}
{{ end }}
{{ end }}
{{ end }}
.IsDirectory doesnβt exist, Iβm looking for way to do just that though.
How can I check if the βitemβ is a file or a directory and operate range
on it or not.
Help would be much appreciated!