I am creating a web page that will handle a lot of PDFs.
I am at the point where I have multiple folders in /static/ containing PDFs, for example /static/Folder1/Files1-x.pdf
This might be trivial but I am learning Hugo and markdown while using it and I have found the forums to be very helpful in learning. Is there a function or other way to take all these PDFs from a specific folder in /static/ and putting them into a list avaliable for download? Maybe a shortcode, but I haven’t really learned how to construct my own yet.
That discussion was of no help; one person wrote a script that I do not understand at all and another person refered to readDir and readFile, which I have read about already but don’t know how to use.
I was hoping to get a little easier explanation on how to do what I need as I have very limited programming knowledge
I want to sort by file name, because right now for some reason all files are in random order and not the order that they are organized (but optimally alphabetically in my case). From what I understand I can use the sort function for this. I do not understand where functions like these should be entered in the code? Or if I am even using it correctly (because I am only getting errors when I try)
Another question I have is if it is possible to change the shortcode so that:
{{ range readDir "static/Folder1" }}
Is somehow “dynamic”? So for example, when using the shortcode, I would instead type