summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/page/index.js1
-rw-r--r--lib/plugins/compatibility.js13
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/page/index.js b/lib/page/index.js
index bcd83e6..f0d7f57 100644
--- a/lib/page/index.js
+++ b/lib/page/index.js
@@ -7,7 +7,6 @@ var error = require('../utils/error');
var pathUtil = require('../utils/path');
var location = require('../utils/location');
var parsers = require('../parsers');
-var gitbook = require('../gitbook');
var pluginCompatibility = require('../plugins/compatibility');
var HTMLPipeline = require('./html');
diff --git a/lib/plugins/compatibility.js b/lib/plugins/compatibility.js
index 9f80c38..eb64e48 100644
--- a/lib/plugins/compatibility.js
+++ b/lib/plugins/compatibility.js
@@ -14,12 +14,13 @@ function pluginCtx(plugin) {
// Call a function "fn" with a context of page similar to the one in GitBook v2
function pageHook(page, fn) {
- var ctx = {
- type: page.type,
- content: page.content,
- path: page.path,
- rawPath: page.rawPath
- };
+ // Get page context
+ var ctx = page.getContext().page;
+
+ // Add other informations
+ ctx.type = page.type;
+ ctx.rawPath = page.rawPath;
+ ctx.path = page.path;
// Deprecate sections
error.deprecateField(ctx, 'sections', [