Is there a way, in a Caddy template to test if a file is a directory or an ordinary file ? I use listFiles in a loop and want different behavior for each entry depending on whether it is a regular file or a folder.
I googled it for a while and did not found useful answers…
I don’t think there is right now. The only built-ins are essentially things that we needed to build the Caddy website and from feature requests on GitHub. Seems like an oversight.
You could add it yourself with a plugin in the namespace http.handlers.templates.functions.*, implementing the CustomFunctions interface.