diff options
Diffstat (limited to 'lib/output')
-rw-r--r-- | lib/output/website.js | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/output/website.js b/lib/output/website.js index 30e0e8c..c1b0a6c 100644 --- a/lib/output/website.js +++ b/lib/output/website.js @@ -32,6 +32,9 @@ function _WebsiteOutput() { // Plugin instance for the default theme this.defaultTheme; + // Resources loaded from plugins + this.resources; + // i18n for themes this.i18n = new I18n(); } @@ -120,7 +123,7 @@ WebsiteOutput.prototype.prepare = function() { }); }) - // Copy assets before copyign files from book + // Copy assets from themes before copying files from book .then(function() { return Promise.serie([ // Assets from the book are already copied @@ -150,6 +153,14 @@ WebsiteOutput.prototype.prepare = function() { } ); }); + }) + + // Load resources for plugins + .then(function() { + return that.plugins.getResources(that.name) + .then(function(resources) { + that.resources = resources; + }); }); }; @@ -185,7 +196,7 @@ WebsiteOutput.prototype.finish = function() { // Copy assets from plugins .then(function() { - return that.plugins.copyResources('website', that.resolve('gitbook')); + return that.plugins.copyResources(that.name, that.resolve('gitbook')); }); }; @@ -203,6 +214,10 @@ WebsiteOutput.prototype.render = function(tpl, context) { // Same template but in the theme theme: path.resolve(templatesPath(this.theme.root), filename) + }, + + plugins: { + resources: this.resources } }); |