Provide pre-processed include capability
It should be possible to do an include prior to compilation of the template, so things like global variables or other bits of included code can be referenced.
I want to place a directive such as the following in any template (regardless of format):
The primary difference in functionality from the existing include/render methods is that it should be possible to do something like this:
globals.scaml:
template.scaml:
The current mechanism using ScalatePackage requires a recompile of the application, whereas this method only requires recompiling the templates. The latter is much preferable for our use case, and I suspect others may also benefit.
I want to place a directive such as the following in any template (regardless of format):
@@include("/path/to/file")
The primary difference in functionality from the existing include/render methods is that it should be possible to do something like this:
globals.scaml:
- lazy val name = "Robbie"
- lazy val address = "123 Main St."
template.scaml:
@@include("globals.scaml")
The address for #{name} is #{address}
The current mechanism using ScalatePackage requires a recompile of the application, whereas this method only requires recompiling the templates. The latter is much preferable for our use case, and I suspect others may also benefit.
Leave a comment