summaryrefslogtreecommitdiffstats
path: root/lib/generators/website.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2015-02-12 12:18:52 +0100
committerSamy Pessé <samypesse@gmail.com>2015-02-12 12:18:52 +0100
commit4ad2b040b462ae2f94922e9ad01d7804eb6d79dc (patch)
treef4703abaf76543d7f484560a5d66e1ee59acf6eb /lib/generators/website.js
parentf5916b5c595cc507bee2a56ccfdfc7eb9ecc4281 (diff)
downloadgitbook-4ad2b040b462ae2f94922e9ad01d7804eb6d79dc.zip
gitbook-4ad2b040b462ae2f94922e9ad01d7804eb6d79dc.tar.gz
gitbook-4ad2b040b462ae2f94922e9ad01d7804eb6d79dc.tar.bz2
Always generate README.json with langs index
remove method langsIndex form generators (moved to finish)
Diffstat (limited to 'lib/generators/website.js')
-rw-r--r--lib/generators/website.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/generators/website.js b/lib/generators/website.js
index 01df98c..d40ffa8 100644
--- a/lib/generators/website.js
+++ b/lib/generators/website.js
@@ -118,7 +118,8 @@ Generator.prototype.finish = function() {
return this.copyAssets()
.then(this.copyCover)
.then(this.writeGlossary)
- .then(this.writeSearchIndex);
+ .then(this.writeSearchIndex)
+ .then(this.writeLangsIndex)
};
// Convert an input file
@@ -156,11 +157,11 @@ Generator.prototype.convertFile = function(input) {
};
// Write the index for langs
-Generator.prototype.langsIndex = function(langs) {
+Generator.prototype.writeLangsIndex = function() {
var that = this;
-
+ if (!this.book.langs.length) return Q();
return this._writeTemplate(this.templates["langs"], {
- langs: langs
+ langs: this.book.langs
}, path.join(this.options.output, "index.html"));
};