mirror of https://github.com/shadowfacts/ekt.git
Don't cache includes
This commit is contained in:
parent
461549eb92
commit
750ab89482
|
@ -29,7 +29,7 @@ val _env = bindings["_env"] as net.shadowfacts.ekt.EKT.TemplateEnvironment
|
||||||
val _result = StringBuilder()
|
val _result = StringBuilder()
|
||||||
fun echo(it: Any) { _result.append(it) }
|
fun echo(it: Any) { _result.append(it) }
|
||||||
fun include(include: String) {
|
fun include(include: String) {
|
||||||
val env = net.shadowfacts.ekt.EKT.TemplateEnvironment(include, _env)
|
val env = net.shadowfacts.ekt.EKT.TemplateEnvironment(include, _env, cacheDir = null)
|
||||||
echo(net.shadowfacts.ekt.EKT.render(env, env.include))
|
echo(net.shadowfacts.ekt.EKT.render(env, env.include))
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
@ -139,12 +139,12 @@ _result.toString()
|
||||||
constructor(name: String, templateDir: File, includeDir: File, cacheDir: File?, init: DataProvider.() -> Unit):
|
constructor(name: String, templateDir: File, includeDir: File, cacheDir: File?, init: DataProvider.() -> Unit):
|
||||||
this(name, templateDir, includeDir, cacheDir, DataProvider.init(init))
|
this(name, templateDir, includeDir, cacheDir, DataProvider.init(init))
|
||||||
|
|
||||||
constructor(name: String, parent: TemplateEnvironment) {
|
constructor(name: String, parent: TemplateEnvironment, cacheDir: File? = parent.cacheDir) {
|
||||||
this.rootName = parent.rootName
|
this.rootName = parent.rootName
|
||||||
this.name = name
|
this.name = name
|
||||||
this.templateDir = parent.templateDir
|
this.templateDir = parent.templateDir
|
||||||
this.includeDir = parent.includeDir
|
this.includeDir = parent.includeDir
|
||||||
this.cacheDir = parent.cacheDir
|
this.cacheDir = cacheDir
|
||||||
this.data = parent.data
|
this.data = parent.data
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue