diff options
Diffstat (limited to 'lib/generate/page')
-rw-r--r-- | lib/generate/page/index.js | 13 |
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"), |