diff options
-rw-r--r-- | lib/page/index.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/page/index.js b/lib/page/index.js index 57b048d..e8c4de7 100644 --- a/lib/page/index.js +++ b/lib/page/index.js @@ -142,8 +142,19 @@ Page.prototype.toHTML = function(output) { this.log.debug.ln('start parsing file', this.path); + function hook(name) { + return output.plugins.hook(name, that.getContext().page) + .then(function(result) { + if(result) that.update(result.content); + }); + } + return this.read() + .then(function() { + return hook('page:before'); + }) + // Pre-process page with parser .then(function() { return that.parser.page.prepare(that.content) @@ -198,6 +209,10 @@ Page.prototype.toHTML = function(output) { .then(that.update); }) + .then(function() { + return hook('page'); + }) + // Return content itself .then(function() { return that.content; |