summaryrefslogtreecommitdiffstats
path: root/lib/generate/site/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/generate/site/index.js')
-rw-r--r--lib/generate/site/index.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/generate/site/index.js b/lib/generate/site/index.js
index 4bea547..9d738be 100644
--- a/lib/generate/site/index.js
+++ b/lib/generate/site/index.js
@@ -54,7 +54,9 @@ Generator.prototype._writeTemplate = function(tpl, options, output) {
githubHost: that.options.githubHost,
summary: that.options.summary,
- allNavigation: that.options.navigation
+ allNavigation: that.options.navigation,
+
+ plugins: that.plugins
}, options));
})
.then(function(html) {
@@ -134,10 +136,24 @@ Generator.prototype.langsIndex = function(langs) {
Generator.prototype.copyAssets = function() {
var that = this;
+ // Copy gitbook assets
return fs.copy(
path.join(that.options.theme, "assets"),
path.join(that.options.output, "gitbook")
- );
+ )
+ // Copy plugins assets
+ .then(function() {
+ return Q.all(
+ _.map(that.plugins.resources, function(resources, resourceType) {
+ return Q.all(_.map(resources, function(resource) {
+ return fs.copy(
+ resource.path,
+ path.join(that.options.output, "gitbook/plugins/", resource.id+"."+resourceType)
+ );
+ }));
+ })
+ );
+ })
};
// Dump search index to disk