mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-18 14:00:39 -07:00
fix: break/continue omitting output before them, #123
BREAKING CHANGE: remove default export, now should be used like import
{Liquid} from 'liquidjs'
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
|
||||
<body>
|
||||
<script>
|
||||
var engine = new window.Liquid({
|
||||
var Liquid = window.liquidjs.Liquid
|
||||
var engine = new Liquid({
|
||||
extname: '.html',
|
||||
cache: true
|
||||
});
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
const express = require('express')
|
||||
const Liquid = require('../..')
|
||||
const { Liquid } = require('liquidjs')
|
||||
|
||||
const app = express()
|
||||
const engine = new Liquid({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
const Liquid = require('liquidjs')
|
||||
const { Liquid } = require('liquidjs')
|
||||
|
||||
const engine = new Liquid({
|
||||
root: __dirname,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import Liquid from 'liquidjs'
|
||||
import { Liquid, TagToken, Hash, Context } from 'liquidjs'
|
||||
|
||||
const engine = new Liquid({
|
||||
root: __dirname,
|
||||
@@ -6,12 +6,12 @@ const engine = new Liquid({
|
||||
})
|
||||
|
||||
engine.registerTag('header', {
|
||||
parse: function (token) {
|
||||
parse: function (token: TagToken) {
|
||||
const [key, val] = token.args.split(':')
|
||||
this[key] = val
|
||||
},
|
||||
render: function (scope, hash) {
|
||||
const title = this.liquid.evalValue(this['content'], scope)
|
||||
render: function (context: Context, hash: Hash) {
|
||||
const title = this.liquid.evalValue(this['content'], context)
|
||||
return `<h1>${title}</h1>`
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user