mirror of
https://github.com/vale981/metalsmith-layouts
synced 2025-03-05 09:31:39 -05:00
Add error handling for unspecified layout
This commit is contained in:
parent
05d80a76a0
commit
6986a9b938
1 changed files with 5 additions and 0 deletions
|
@ -107,6 +107,11 @@ function plugin(opts){
|
|||
debug('converting file: %s', file);
|
||||
var data = files[file];
|
||||
|
||||
// Require a default or a layout to be specified for each file
|
||||
if(!data.layout && !def) {
|
||||
throw new Error('No layout specified for ' + file);
|
||||
}
|
||||
|
||||
// Deep clone params (by passing 'true')
|
||||
var clonedParams = extend(true, {}, params);
|
||||
var clone = extend({}, clonedParams, metadata, data);
|
||||
|
|
Loading…
Add table
Reference in a new issue