Templates with data sources

This is more of a feature request then a help question - though maybe someone might propose an alternative approach to what I’m trying to do.

I want to be able to generate some “real-time-ish” reports through the “templates” system. Ideally, there would be a way I could declare a “data source” (a reference to a json file or url) that could be loaded and be available to the template system. I have a bunch of use cases for something like this. However, I see no way to make additional objects available in the templating system. (Or even add new func - which would also do the trick.)

I do have an alternative - which is to use something like gomplate to generate my template from another template that inserts all the data. However, this would need to another process I’d need to add to the web site that would periodically or on-demand update those templates.

I’m wondering if any others have tried to do something like this with Caddy and perhaps have some suggestions?


Just to crosslink the discussions:


This topic was automatically closed after 30 days. New replies are no longer allowed.