html-brunch-static
Advanced tools
Comparing version 1.3.3 to 1.4.0
11
index.js
@@ -219,3 +219,3 @@ var _, anymatch, handlebars, log, minify, path, yaml; | ||
return _this.compilePartials(htmlBrunchStatic, hbs, function(err) { | ||
var processor; | ||
var afterCompile, processor; | ||
if (err) { | ||
@@ -230,3 +230,3 @@ callback(err); | ||
try { | ||
return processor.compile(_this.template, _this.filename, _this.options, function(err, content, dependencies) { | ||
afterCompile = function(err, content, dependencies) { | ||
var hbsOptions, ref, result, template; | ||
@@ -249,3 +249,8 @@ if (err) { | ||
} | ||
}); | ||
}; | ||
if (processor.acceptsContext) { | ||
return processor.compile(_this.template, _this.filename, _this.options, _this.context, afterCompile); | ||
} else { | ||
return processor.compile(_this.template, _this.filename, _this.options, afterCompile); | ||
} | ||
} catch (error) { | ||
@@ -252,0 +257,0 @@ err = error; |
@@ -12,3 +12,3 @@ { | ||
], | ||
"version": "1.3.3", | ||
"version": "1.4.0", | ||
"homepage": "https://github.com/bmatcuk/html-brunch-static", | ||
@@ -26,4 +26,4 @@ "license": "MIT", | ||
"anymatch": "^1.3.2", | ||
"handlebars": "^4.0.10", | ||
"html-minifier": "^3.5.3", | ||
"handlebars": "^4.0.11", | ||
"html-minifier": "^3.5.8", | ||
"lodash.merge": "^4.6.0", | ||
@@ -33,5 +33,5 @@ "yaml-front-matter": "^3.4.0" | ||
"devDependencies": { | ||
"brunch": "^2.10.10", | ||
"brunch": "^2.10.12", | ||
"coffee-script-brunch": "^2.10.2" | ||
} | ||
} |
@@ -237,2 +237,3 @@ ![Release](https://img.shields.io/npm/v/html-brunch-static.svg) | ||
transformPath: function(filename) { ... }, | ||
acceptsContext: true/false, | ||
compile: function(data, filename, options, callback) { ... } | ||
@@ -259,1 +260,3 @@ }; | ||
* **acceptsContext** | ||
> If _acceptsContext_ is `true`, _compile_ will be called with one additional parameter before the callback: the [context](#context-layouts-and-partials). That makes the _compile_ function look like: `function(data, filename, options, context, callback)`. This might be useful if your processor has some way of using the context. For example, the [pug](https://github.com/bmatcuk/pug-brunch-static) processor exposes the context as local variables for use in the pug template. |
Sorry, the diff of this file is not supported yet
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
41386
422
261
13
Updatedhandlebars@^4.0.11
Updatedhtml-minifier@^3.5.8