summaryrefslogtreecommitdiffstats
path: root/lib/generate/site/index.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-06 13:43:20 -0700
committerSamy Pessé <samypesse@gmail.com>2014-04-06 13:43:20 -0700
commit65cb23feabb7ae311f18c5f50978686d202dafec (patch)
tree4b7a40abe74cce7b961f8a3bc63da9d4f044b315 /lib/generate/site/index.js
parent2b3c67a26b1d8a1163dbf26c399786782e6f1716 (diff)
downloadgitbook-65cb23feabb7ae311f18c5f50978686d202dafec.zip
gitbook-65cb23feabb7ae311f18c5f50978686d202dafec.tar.gz
gitbook-65cb23feabb7ae311f18c5f50978686d202dafec.tar.bz2
Fix generation for page format
Diffstat (limited to 'lib/generate/site/index.js')
-rw-r--r--lib/generate/site/index.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/generate/site/index.js b/lib/generate/site/index.js
index a8626a9..9c3c10c 100644
--- a/lib/generate/site/index.js
+++ b/lib/generate/site/index.js
@@ -87,17 +87,23 @@ Generator.prototype.convertFile = function(content, _input) {
// Generate languages index
Generator.prototype.langsIndex = function(langs) {
+ var that = this;
var basePath = ".";
+
return this._writeTemplate(this.langsTemplate, {
langs: langs.list,
basePath: basePath,
staticBase: path.join(basePath, "gitbook"),
- }, path.join(this.options.output, "index.html"));
+ }, path.join(this.options.output, "index.html"))
+ .then(function() {
+ // Copy assets
+ return that.copyAssets();
+ });
};
-// Symlink index.html and copy assets
-Generator.prototype.finish = function() {
+// Copy assets
+Generator.prototype.copyAssets = function() {
var that = this;
return fs.copy(
@@ -105,5 +111,6 @@ Generator.prototype.finish = function() {
path.join(that.options.output, "gitbook")
);
};
+Generator.prototype.finish = Generator.prototype.copyAssets;
module.exports = Generator; \ No newline at end of file