feat: renderSync, parseAndRenderSync and renderFileSync, see #48

This commit is contained in:
harttle
2019-08-26 10:15:43 -05:00
committed by Jun Yang
parent 8028f82499
commit 7fb01ad69a
66 changed files with 896 additions and 272 deletions
+3 -3
View File
@@ -10,9 +10,9 @@ engine.registerTag('header', {
const [key, val] = token.args.split(':')
this[key] = val
},
render: function (scope, hash) {
const title = this.liquid.evalValue(this.content, scope)
return `<h1>${title}</h1>`
render: async function (scope, hash, emitter) {
const title = await this.liquid.evalValue(this.content, scope)
emitter.write(`<h1>${title}</h1>`)
}
})