work.suroh.tk/node_modules/liquidjs/demo/nodejs/index.js

13 lines
279 B
JavaScript

const Liquid = require('liquidjs')
const engine = new Liquid({
root: __dirname,
extname: '.liquid'
})
const ctx = {
todos: ['fork and clone', 'make it better', 'make a pull request'],
title: 'Welcome to liquidjs!'
}
engine.renderFile('todolist', ctx).then(console.log)