mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-29 07:05:13 -07:00
chore(TypeScript): ship Liquid to class
BREAKING CHANGE: calling `Liquid()` without `new` now becomes invalid
This commit is contained in:
+3
-3
@@ -1,8 +1,8 @@
|
||||
const express = require('express')
|
||||
const Liquid = require('../..')
|
||||
|
||||
let app = express()
|
||||
let engine = Liquid({
|
||||
const app = express()
|
||||
const engine = new Liquid({
|
||||
root: __dirname, // for layouts and partials
|
||||
extname: '.liquid'
|
||||
})
|
||||
@@ -12,7 +12,7 @@ app.set('views', ['./partials', './views']) // specify the views directory
|
||||
app.set('view engine', 'liquid') // set to default
|
||||
|
||||
app.get('/', function (req, res) {
|
||||
let todos = ['fork and clone', 'make it better', 'make a pull request']
|
||||
const todos = ['fork and clone', 'make it better', 'make a pull request']
|
||||
res.render('todolist', {
|
||||
todos: todos,
|
||||
title: 'Welcome to liquidjs!'
|
||||
|
||||
Reference in New Issue
Block a user