mirror of
https://github.com/harttle/liquidjs.git
synced 2026-10-03 09:05:14 -07:00
docs: fix demos
This commit is contained in:
@@ -10,7 +10,7 @@ engine.registerTag('header', {
|
|||||||
const [key, val] = token.args.split(':')
|
const [key, val] = token.args.split(':')
|
||||||
this[key] = val
|
this[key] = val
|
||||||
},
|
},
|
||||||
render: async function (scope, hash, emitter) {
|
render: async function (scope, emitter) {
|
||||||
const title = await this.liquid.evalValue(this.content, scope)
|
const title = await this.liquid.evalValue(this.content, scope)
|
||||||
emitter.write(`<h1>${title}</h1>`)
|
emitter.write(`<h1>${title}</h1>`)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,5 +21,8 @@
|
|||||||
"not dead",
|
"not dead",
|
||||||
"not ie <= 11",
|
"not ie <= 11",
|
||||||
"not op_mini all"
|
"not op_mini all"
|
||||||
]
|
],
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.8.7"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Liquid, TagToken, Hash, Context, Emitter } from 'liquidjs'
|
import { Liquid, TagToken, Context, Emitter } from 'liquidjs'
|
||||||
|
|
||||||
const engine = new Liquid({
|
const engine = new Liquid({
|
||||||
root: __dirname,
|
root: __dirname,
|
||||||
@@ -10,7 +10,7 @@ engine.registerTag('header', {
|
|||||||
const [key, val] = token.args.split(':')
|
const [key, val] = token.args.split(':')
|
||||||
this[key] = val
|
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)
|
const title = await this.liquid.evalValue(this['content'], context)
|
||||||
emitter.write(`<h1>${title}</h1>`)
|
emitter.write(`<h1>${title}</h1>`)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user