Skip to content

Commit

Permalink
Added plates support
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Worthen committed Jan 24, 2013
1 parent 49cb9ae commit 09f8138
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- [JUST](https://github.com/baryshev/just)
- [liquor](https://github.com/chjj/liquor)
- [mustache](https://github.com/janl/mustache.js)
- [plates](https://github.com/flatiron/plates)
- [QEJS](https://github.com/jepso/QEJS)
- [swig](https://github.com/paularmstrong/swig) [(website)](http://paularmstrong.github.com/swig/)
- [toffee](https://github.com/malgorithms/toffee)
Expand Down Expand Up @@ -67,6 +68,27 @@ cons[name]('views/page.html', { user: 'tobi' }, function(err, html){
console.log(html);
});
```
### Example using [Plates](https://github.com/flatiron/plates)

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.

```js
var cons = require('consolidate')
, _map = require('plates').Map();

_map.class('list').append('views/partial.html', {item: ['one', 'two']});
cons.plates('views/user.html', {user: 'Tobi', map: _map}, function(err, html) {
if (err) throw err;
console.log(html);
});

// user.html
<p id="user"></p>
<ul class="list"&gt>

// partial.html
<li id="item"></item>
```

## Caching

Expand Down

0 comments on commit 09f8138

Please sign in to comment.