Skip to content

Commit 09f8138

Browse files
author
Derek Worthen
committed
Added plates support
1 parent 49cb9ae commit 09f8138

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

Readme.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
- [JUST](https://github.com/baryshev/just)
2424
- [liquor](https://github.com/chjj/liquor)
2525
- [mustache](https://github.com/janl/mustache.js)
26+
- [plates](https://github.com/flatiron/plates)
2627
- [QEJS](https://github.com/jepso/QEJS)
2728
- [swig](https://github.com/paularmstrong/swig) [(website)](http://paularmstrong.github.com/swig/)
2829
- [toffee](https://github.com/malgorithms/toffee)
@@ -67,6 +68,27 @@ cons[name]('views/page.html', { user: 'tobi' }, function(err, html){
6768
console.log(html);
6869
});
6970
```
71+
### Example using [Plates](https://github.com/flatiron/plates)
72+
73+
Since plates' bind method accepts a third argument, a map object, consolidate has to map arguments to plates differently than the other engines. To pass a map object to the template add it to options.map.
74+
75+
```js
76+
var cons = require('consolidate')
77+
, _map = require('plates').Map();
78+
79+
_map.class('list').append('views/partial.html', {item: ['one', 'two']});
80+
cons.plates('views/user.html', {user: 'Tobi', map: _map}, function(err, html) {
81+
if (err) throw err;
82+
console.log(html);
83+
});
84+
85+
// user.html
86+
<p id="user"></p>
87+
<ul class="list"&gt>
88+
89+
// partial.html
90+
<li id="item"></item>
91+
```
7092

7193
## Caching
7294

0 commit comments

Comments
 (0)