diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-13 15:51:14 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-13 15:51:14 +0100 |
commit | 71059e3ea3ea9af156987a0dd4cb0a5457b0316c (patch) | |
tree | fd4d8fc8b279e6b0521bd8954c8d285abb5cdd7d /lib/output | |
parent | ee3faaad1106bb773078e580c9c1611c8f31607c (diff) | |
download | gitbook-71059e3ea3ea9af156987a0dd4cb0a5457b0316c.zip gitbook-71059e3ea3ea9af156987a0dd4cb0a5457b0316c.tar.gz gitbook-71059e3ea3ea9af156987a0dd4cb0a5457b0316c.tar.bz2 |
Ignore Summary and Langs in output
Diffstat (limited to 'lib/output')
-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); |