metalsmith-layouts
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -0,1 +1,6 @@ | ||
1.4.1 - September 19, 2015 | ||
-------------------------- | ||
* move check for unspecified layout, #41 | ||
* update devdependencies | ||
1.4.0 - August 14, 2015 | ||
@@ -2,0 +7,0 @@ ----------------------- |
@@ -20,6 +20,6 @@ /** | ||
*/ | ||
function check(files, file, pattern){ | ||
function check(files, file, pattern, def){ | ||
var data = files[file]; | ||
// Don't process binary files | ||
// Only process utf8 encoded files (so no binary) | ||
if (!utf8(data.contents)) { | ||
@@ -34,3 +34,8 @@ return false; | ||
// Only process files with a specified layout | ||
if(!data.layout && !def) { | ||
return false; | ||
} | ||
return true; | ||
} |
@@ -39,3 +39,2 @@ /** | ||
*/ | ||
function plugin(opts){ | ||
@@ -91,6 +90,6 @@ /** | ||
/** | ||
* Stringify files that pass the check, and store in matches | ||
* Stringify files that pass the check, pass to matches | ||
*/ | ||
Object.keys(files).forEach(function(file){ | ||
if (!check(files, file, pattern)) { | ||
if (!check(files, file, pattern, def)) { | ||
return; | ||
@@ -112,7 +111,2 @@ } | ||
// Ignore files without a specified layout | ||
if(!data.layout && !def) { | ||
return done(); | ||
} | ||
// Deep clone params (by passing 'true') | ||
@@ -119,0 +113,0 @@ var clonedParams = extend(true, {}, params); |
@@ -6,3 +6,3 @@ { | ||
"repository": "git://github.com/superwolff/metalsmith-layouts.git", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"license": "MIT", | ||
@@ -26,3 +26,3 @@ "main": "lib/index.js", | ||
"eslint": "^1.0.0", | ||
"handlebars": "^3.0.3", | ||
"handlebars": "^4.0.2", | ||
"metalsmith": "^2.0.1", | ||
@@ -29,0 +29,0 @@ "mocha": "^2.2.5", |
251615