Skip to content

Commit

Permalink
Fixed caching issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Derek Worthen committed Feb 5, 2013
1 parent 8c1ea52 commit 4888af3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,6 @@ cons[name]('views/page.html', { user: 'tobi' }, function(err, html){
console.log(html);
});
```
### Example using [Plates](https://github.com/flatiron/plates)

Plates accepts an optional third argument, a mapping object. To pass a map object through consolidate 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);
});
```

## Caching

Expand Down
2 changes: 1 addition & 1 deletion lib/consolidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ exports.plates.render = function(str, options, fn) {
var engine = requires.plates || (requires.plates = require('plates'))
, map = options.map || undefined;
try {
var tmpl = cache(options) || cache(options, engine.bind(str, options, map));
var tmpl = engine.bind(str, options, map);
fn(null, tmpl);
} catch (err) {
fn(err);
Expand Down

0 comments on commit 4888af3

Please sign in to comment.