templates
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -49,3 +49,5 @@ 'use strict'; | ||
view._context = this.ctx(view, locals, opts); | ||
var context = this.ctx(view, locals, opts); | ||
view._context = utils.merge({}, this.context, context); | ||
view.render(function(err, res) { | ||
@@ -52,0 +54,0 @@ if (err) return cb(err); |
@@ -346,8 +346,12 @@ 'use strict'; | ||
file._context = app.options.cacheContext(file, context, app); | ||
} else if (typeof app.options.context === 'function') { | ||
return app.options.context(file, context, app); | ||
} else if (app.options.cacheContext === true && typeof file.context === 'function') { | ||
return (file._context || file.context(context)); | ||
} else if (typeof file.context === 'function') { | ||
if (app.options.cacheContext === true) { | ||
return (file._context || file.context(app.cache.data, context)); | ||
} | ||
return file.context(app.cache.data, context); | ||
} else { | ||
@@ -354,0 +358,0 @@ return context; |
{ | ||
"name": "templates", | ||
"description": "System for creating and managing template collections, and rendering templates with any node.js template engine. Can be used as the basis for creating a static site generator or blog framework.", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"homepage": "https://github.com/jonschlinkert/templates", | ||
@@ -48,3 +48,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"is-valid-app": "^0.2.1", | ||
"layouts": "^0.11.0", | ||
"layouts": "^0.12.1", | ||
"lazy-cache": "^2.0.2", | ||
@@ -58,3 +58,3 @@ "match-file": "^0.2.1", | ||
"vinyl-item": "^1.0.0", | ||
"vinyl-view": "^1.0.0" | ||
"vinyl-view": "^2.0.0" | ||
}, | ||
@@ -61,0 +61,0 @@ "devDependencies": { |
@@ -627,3 +627,3 @@ # templates [![NPM version](https://img.shields.io/npm/v/templates.svg?style=flat)](https://www.npmjs.com/package/templates) [![NPM monthly downloads](https://img.shields.io/npm/dm/templates.svg?style=flat)](https://npmjs.org/package/templates) [![NPM total downloads](https://img.shields.io/npm/dt/templates.svg?style=flat)](https://npmjs.org/package/templates) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/templates.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/templates) | ||
### [.mergePartials](lib/plugins/context.js#L321) | ||
### [.mergePartials](lib/plugins/context.js#L322) | ||
@@ -639,3 +639,3 @@ Merge "partials" view types. This is necessary for template | ||
### [.mergePartialsAsync](lib/plugins/context.js#L362) | ||
### [.mergePartialsAsync](lib/plugins/context.js#L363) | ||
@@ -736,3 +736,3 @@ Merge "partials" view types. This is necessary for template engines | ||
### [.mergePartials](lib/plugins/context.js#L321) | ||
### [.mergePartials](lib/plugins/context.js#L322) | ||
@@ -748,3 +748,3 @@ Merge "partials" view types. This is necessary for template | ||
### [.mergePartialsAsync](lib/plugins/context.js#L362) | ||
### [.mergePartialsAsync](lib/plugins/context.js#L363) | ||
@@ -959,3 +959,3 @@ Merge "partials" view types. This is necessary for template engines | ||
### [.mergePartials](lib/plugins/context.js#L321) | ||
### [.mergePartials](lib/plugins/context.js#L322) | ||
@@ -971,3 +971,3 @@ Merge "partials" view types. This is necessary for template | ||
### [.mergePartialsAsync](lib/plugins/context.js#L362) | ||
### [.mergePartialsAsync](lib/plugins/context.js#L363) | ||
@@ -1213,3 +1213,3 @@ Merge "partials" view types. This is necessary for template engines | ||
### [.mergePartials](lib/plugins/context.js#L321) | ||
### [.mergePartials](lib/plugins/context.js#L322) | ||
@@ -1225,3 +1225,3 @@ Merge "partials" view types. This is necessary for template | ||
### [.mergePartialsAsync](lib/plugins/context.js#L362) | ||
### [.mergePartialsAsync](lib/plugins/context.js#L363) | ||
@@ -1526,3 +1526,3 @@ Merge "partials" view types. This is necessary for template engines | ||
### [.mergePartials](lib/plugins/context.js#L321) | ||
### [.mergePartials](lib/plugins/context.js#L322) | ||
@@ -1538,3 +1538,3 @@ Merge "partials" view types. This is necessary for template | ||
### [.mergePartialsAsync](lib/plugins/context.js#L362) | ||
### [.mergePartialsAsync](lib/plugins/context.js#L363) | ||
@@ -1740,3 +1740,3 @@ Merge "partials" view types. This is necessary for template engines | ||
### [.mergePartials](lib/plugins/context.js#L321) | ||
### [.mergePartials](lib/plugins/context.js#L322) | ||
@@ -1752,3 +1752,3 @@ Merge "partials" view types. This is necessary for template | ||
### [.mergePartialsAsync](lib/plugins/context.js#L362) | ||
### [.mergePartialsAsync](lib/plugins/context.js#L363) | ||
@@ -2312,3 +2312,3 @@ Merge "partials" view types. This is necessary for template engines | ||
| --- | --- | | ||
| 722 | [jonschlinkert](https://github.com/jonschlinkert) | | ||
| 732 | [jonschlinkert](https://github.com/jonschlinkert) | | ||
| 105 | [doowb](https://github.com/doowb) | | ||
@@ -2349,2 +2349,2 @@ | 1 | [chronzerg](https://github.com/chronzerg) | | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 01, 2017._ | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.2, on February 08, 2017._ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
175834
3393
+ Addedlayouts@0.12.1(transitive)
+ Addedvinyl-view@2.0.1(transitive)
- Removedlayouts@0.11.0(transitive)
- Removedvinyl-view@1.0.0(transitive)
Updatedlayouts@^0.12.1
Updatedvinyl-view@^2.0.0