mirror of
https://github.com/harttle/liquidjs.git
synced 2026-10-03 00:55:13 -07:00
feature: root option allows array of strings
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
var express = require('express');
|
||||
var app = express();
|
||||
var Liquid = require('../..');
|
||||
|
||||
var engine = Liquid({
|
||||
root: __dirname, // for layouts and partials
|
||||
extname: '.liquid'
|
||||
});
|
||||
|
||||
app.engine('liquid', engine.express()); // register liquid engine
|
||||
app.set('views', __dirname); // specify the views directory
|
||||
app.set('view engine', 'liquid'); // set to default
|
||||
|
||||
app.get('/', function (req, res) {
|
||||
var todos = ['fork and clone', 'make it better', 'make a pull request'];
|
||||
res.render('todolist', {
|
||||
todos: todos,
|
||||
title: 'Welcome to shopify-liquid!'
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
Reference in New Issue
Block a user