diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/output/base.js | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/output/base.js b/lib/output/base.js index 9acfb87..853fa30 100644 --- a/lib/output/base.js +++ b/lib/output/base.js @@ -28,7 +28,11 @@ function Output(book, type) { '.bookignore', // The configuration file should not be copied in the output - this.book.config.path + this.book.config.path, + + // Structure file to ignore + this.book.summary.path, + this.book.langs.path ])); } @@ -61,15 +65,20 @@ Output.prototype.generate = function() { // We want to process assets first, then pages // Since pages can have logic based on existance of assets .then(function(files) { - // Ignore file present in a language book - files = _.filter(files, function(filename) { - return !(isMultilingual && that.book.isInLanguageBook(filename)); - }); + // Split into pages/assets + var byTypes = _.chain(files) + .filter(that.ignore.createFilter()) - // List assets - var byTypes = _.groupBy(files, function(filename) { - return (that.book.hasPage(filename)? 'page' : 'asset'); - }); + // Ignore file present in a language book + .filter(function(filename) { + return !(isMultilingual && that.book.isInLanguageBook(filename)); + }) + + .groupBy(function(filename) { + return (that.book.hasPage(filename)? 'page' : 'asset'); + }) + + .value(); return Promise.serie(byTypes.asset, function(filename) { return that.onAsset(filename); |