summaryrefslogtreecommitdiffstats
path: root/lib/generate/site/index.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-19 19:31:02 +0200
committerSamy Pessé <samypesse@gmail.com>2014-04-19 19:31:02 +0200
commitfb14caf5b3cfc321910ccb3ff57082dd7a43e51a (patch)
treed4f4a81043721709b35dabee32be78f4a43a23a4 /lib/generate/site/index.js
parentcf51772f541ae09265f37ff0662da529ca857d4f (diff)
downloadgitbook-fb14caf5b3cfc321910ccb3ff57082dd7a43e51a.zip
gitbook-fb14caf5b3cfc321910ccb3ff57082dd7a43e51a.tar.gz
gitbook-fb14caf5b3cfc321910ccb3ff57082dd7a43e51a.tar.bz2
Add resources to site build
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