feat: alias getTemplate() to parseFile()

* deprecate Liquid#getTemplate: use Liquid#parseFile instead
* deprecate Liquid#getTemplateSync: use Liquid#parseFileSync instead
This commit is contained in:
harttle
2019-10-07 23:34:12 +08:00
parent 4f8fc89c6f
commit 6b83788077
3 changed files with 32 additions and 22 deletions
+2 -2
View File
@@ -39,7 +39,7 @@ export default {
if (this.with) {
hash[filepath] = new Expression(this.with).evaluateSync(ctx)
}
const templates = this.liquid.getTemplateSync(filepath, ctx.opts)
const templates = this.liquid.parseFileSync(filepath, ctx.opts)
ctx.push(hash)
this.liquid.renderer.renderTemplatesSync(templates, ctx, emitter)
ctx.pop()
@@ -69,7 +69,7 @@ export default {
if (this.with) {
hash[filepath] = await new Expression(this.with).evaluate(ctx)
}
const templates = await this.liquid.getTemplate(filepath, ctx.opts)
const templates = await this.liquid.parseFile(filepath, ctx.opts)
ctx.push(hash)
await this.liquid.renderer.renderTemplates(templates, ctx, emitter)
ctx.pop()
+2 -2
View File
@@ -39,8 +39,8 @@ export default {
blocks[''] = html
}
const templates = ctx.sync
? this.liquid.getTemplateSync(layout, ctx.opts)
: await this.liquid.getTemplate(layout, ctx.opts)
? this.liquid.parseFileSync(layout, ctx.opts)
: await this.liquid.parseFile(layout, ctx.opts)
ctx.push(hash)
ctx.setRegister('blockMode', BlockMode.OUTPUT)
const partial = ctx.sync