mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 21:00:40 -07:00
feat: alias getTemplate() to parseFile()
* deprecate Liquid#getTemplate: use Liquid#parseFile instead * deprecate Liquid#getTemplateSync: use Liquid#parseFileSync instead
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user