Including files/scripts

Not by running an arbitrary shell script, no. The closest thing currently is httpInclude which makes another HTTP request for more content.

Unfortunately we haven’t bothered making the templates module pluggable yet (to allow plugins to add their own functions) but that would be a possible refactor that would allow a plugin to provide this kind of functionality.

I’m not sure arbitrary shell execution is something we necessarily want in the standard distribution of Caddy, it’s probably better left to a plugin to provide (once templates is made extensible).

FYI, I opened up a feature request issue for this:

1 Like