summaryrefslogtreecommitdiffstats
path: root/lib/generate/page/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/page/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/page/index.js')
-rw-r--r--lib/generate/page/index.js24
1 files changed, 3 insertions, 21 deletions
diff --git a/lib/generate/page/index.js b/lib/generate/page/index.js
index 7f730ea..ac815e7 100644
--- a/lib/generate/page/index.js
+++ b/lib/generate/page/index.js
@@ -7,7 +7,7 @@ var hljs = require('highlight.js');
var fs = require("../fs");
var parse = require("../../parse");
-var BaseGenerator = require("../generator");
+var BaseGenerator = require("../site");
// Swig filter: highlight coloration
swig.setFilter('code', function(code, lang) {
@@ -71,30 +71,12 @@ Generator.prototype.finish = function() {
return Q()
// Generate html
.then(function(pages) {
- return that.template({
- title: that.options.title,
- description: that.options.description,
-
- githubAuthor: that.options.github.split("/")[0],
- githubId: that.options.github,
- githubHost: that.options.githubHost,
-
- summary: that.options.summary,
- allNavigation: that.options.navigation,
-
+ return that._writeTemplate(that.template, {
pages: that.pages,
basePath: basePath,
staticBase: path.join(basePath, "gitbook"),
- });
- })
-
- // Write html to index.html
- .then(function(html) {
- return fs.writeFile(
- output,
- html
- );
+ }, output);
})
// Copy assets