docs: fix demos

This commit is contained in:
harttle
2020-03-10 01:08:25 +08:00
parent 2c428221cb
commit 06ad0481db
3 changed files with 30 additions and 27 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ engine.registerTag('header', {
const [key, val] = token.args.split(':')
this[key] = val
},
render: async function (scope, hash, emitter) {
render: async function (scope, emitter) {
const title = await this.liquid.evalValue(this.content, scope)
emitter.write(`<h1>${title}</h1>`)
}
+4 -1
View File
@@ -21,5 +21,8 @@
"not dead",
"not ie <= 11",
"not op_mini all"
]
],
"devDependencies": {
"@babel/core": "^7.8.7"
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
import { Liquid, TagToken, Hash, Context, Emitter } from 'liquidjs'
import { Liquid, TagToken, Context, Emitter } from 'liquidjs'
const engine = new Liquid({
root: __dirname,
@@ -10,7 +10,7 @@ engine.registerTag('header', {
const [key, val] = token.args.split(':')
this[key] = val
},
render: async function (context: Context, hash: Hash, emitter: Emitter) {
render: async function (context: Context, emitter: Emitter) {
const title = await this.liquid.evalValue(this['content'], context)
emitter.write(`<h1>${title}</h1>`)
}