summaryrefslogtreecommitdiffstats
path: root/lib/generators
diff options
context:
space:
mode:
Diffstat (limited to 'lib/generators')
-rw-r--r--lib/generators/ebook.js3
-rw-r--r--lib/generators/website.js15
2 files changed, 12 insertions, 6 deletions
diff --git a/lib/generators/ebook.js b/lib/generators/ebook.js
index e9ca20c..eb84df8 100644
--- a/lib/generators/ebook.js
+++ b/lib/generators/ebook.js
@@ -14,6 +14,9 @@ var Generator = function(book, format) {
// eBook format
this.ebookFormat = format;
+ // Resources namespace
+ this.namespace = "ebook";
+
// Styles to use
this.styles = _.compact(["ebook", this.ebookFormat]);
diff --git a/lib/generators/website.js b/lib/generators/website.js
index 0187416..bedf1af 100644
--- a/lib/generators/website.js
+++ b/lib/generators/website.js
@@ -18,9 +18,12 @@ var pkg = require("../../package.json");
var Generator = function() {
BaseGenerator.apply(this, arguments);
- // revision
+ // Revision
this.revision = new Date();
+ // Resources namespace
+ this.namespace = "website";
+
// Style to integrates in the output
this.styles = ["website"];
@@ -236,9 +239,11 @@ Generator.prototype._writeTemplate = function(tpl, options, output, interpolate)
summary: that.book.summary,
allNavigation: that.book.navigation,
- plugins: that.book.plugins,
+ plugins: {
+ resources: that.book.plugins.resources(that.namespace)
+ },
pluginsConfig: JSON.stringify(that.options.pluginsConfig),
- htmlSnippet: _.partialRight(that.book.plugins.html, that, options),
+ htmlSnippet: _.partial(_.partialRight(that.book.plugins.html, that, options), that.namespace),
options: that.options,
@@ -271,9 +276,7 @@ Generator.prototype.copyAssets = function() {
return Q.all(
_.map(that.book.plugins.list, function(plugin) {
var pluginAssets = path.join(that.options.output, "gitbook/plugins/", plugin.name);
- return plugin.copyAssets(pluginAssets, {
- base: "book"
- });
+ return plugin.copyAssets(pluginAssets, that.namespace);
})
);
});