Permalink
Browse files

更新README

  • Loading branch information...
1 parent a7acf39 commit eccac336471d7095af3cf5b18d50cdcee82a46d4 @leizongmin committed Nov 3, 2014
Showing with 12 additions and 3 deletions.
  1. +12 −3 README.md
View
@@ -7,11 +7,11 @@ Install
=======
```bash
-npm install express-liquid
+npm install express-liquid --save
```
-Using TinyLiquid in Express 3.x
+Using TinyLiquid in Express 3.x & 4.x
===============================
## 1. Initialization
@@ -32,14 +32,23 @@ var options = {
};
app.set('view engine', 'liquid');
app.engine('liquid', expressLiquid(options));
+app.use(expressLiquid.middleware);
```
More about **TinyLiquid**, see https://github.com/leizongmin/tinyliquid
## 2. Render a template
```javascript
-res.render('template_name', {context: context});
+res.render('template_name', {a: 'hello', b: 'world'});
+```
+
+or
+
+```javascript
+res.locals.a = 'hello';
+res.locals.b = 'world';
+res.render('template_name');
```
## 3. About the **include** tag: {% include %}

0 comments on commit eccac33

Please sign in to comment.