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!