mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 04:40:39 -07:00
add: demo
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<footer>Copyright @ 2016, Harttle</footer>
|
||||
@@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Welcome to shopify-liquid!</h1>
|
||||
{% include 'bar' %}
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,20 @@
|
||||
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) {
|
||||
res.render('foo');
|
||||
});
|
||||
|
||||
app.listen(3000, function () {
|
||||
console.log('Example app listening on port 3000!');
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "express-demo",
|
||||
"version": "1.0.0",
|
||||
"description": "Express Demo Using Shopify-Liquid",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "harttle",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"express": "^4.14.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user