summaryrefslogtreecommitdiffstats
path: root/lib/generate/page/index.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-04 17:40:37 -0700
committerSamy Pessé <samypesse@gmail.com>2014-04-04 17:40:37 -0700
commit7ab285832bc40a41df4659b059b4ef4c4728e1ba (patch)
tree4b7edfd24cc82c3e2608a74ad9ec4a47ce16fdb9 /lib/generate/page/index.js
parent9fbe2408432bfeed1db330bc69372a43f0bb0506 (diff)
downloadgitbook-7ab285832bc40a41df4659b059b4ef4c4728e1ba.zip
gitbook-7ab285832bc40a41df4659b059b4ef4c4728e1ba.tar.gz
gitbook-7ab285832bc40a41df4659b059b4ef4c4728e1ba.tar.bz2
Improve style for page printing
Diffstat (limited to 'lib/generate/page/index.js')
-rw-r--r--lib/generate/page/index.js13
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/generate/page/index.js b/lib/generate/page/index.js
index a8fc866..f2c7b60 100644
--- a/lib/generate/page/index.js
+++ b/lib/generate/page/index.js
@@ -19,7 +19,7 @@ var Generator = function() {
this.template = swig.compileFile(path.resolve(this.options.theme, 'templates/page.html'));
// List of pages content
- this.pages = [];
+ this.pages = {};
};
util.inherits(Generator, BaseGenerator);
@@ -49,7 +49,7 @@ Generator.prototype.convertFile = function(content, input) {
json.content = sections;
})
.then(function() {
- that.pages.push(json);
+ that.pages[input] = json;
});
};
@@ -59,13 +59,6 @@ Generator.prototype.finish = function() {
var output = path.join(this.options.output, "index.html");
return Q()
- // Order pages
- .then(function() {
- return _.sortBy(that.pages, function(page) {
- return page.progress.current.level;
- });
- })
-
// Generate html
.then(function(pages) {
return that.template({
@@ -79,7 +72,7 @@ Generator.prototype.finish = function() {
summary: that.options.summary,
allNavigation: that.options.navigation,
- pages: pages,
+ pages: that.pages,
basePath: basePath,
staticBase: path.join(basePath, "gitbook"),