diff options
Diffstat (limited to 'lib/page/index.js')
-rw-r--r-- | lib/page/index.js | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/lib/page/index.js b/lib/page/index.js index c4d2721..45b3598 100644 --- a/lib/page/index.js +++ b/lib/page/index.js @@ -6,6 +6,7 @@ var error = require('../utils/error'); var pathUtil = require('../utils/path'); var location = require('../utils/location'); var parsers = require('../parsers'); +var gitbook = require('../gitbook'); var HTMLPipeline = require('./html'); /* @@ -109,21 +110,28 @@ Page.prototype.getContext = function() { if (dir == 'neutral') dir = null; } - return { - file: { - path: this.path, - mtime: this.mtime, - type: this.type + return _.extend( + { + file: { + path: this.path, + mtime: this.mtime, + type: this.type + }, + page: { + title: article? article.title : null, + next: next? next.getContext() : null, + previous: prev? prev.getContext() : null, + level: article? article.level : null, + content: this.content, + dir: dir + } }, - page: { - title: article? article.title : null, - next: next? next.getContext() : null, - previous: prev? prev.getContext() : null, - level: article? article.level : null, - content: this.content, - dir: dir - } - }; + gitbook.getContext(), + this.book.getContext(), + this.book.summary.getContext(), + this.book.glossary.getContext(), + this.book.config.getContext() + ); }; // Parse the page and return its content |