summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-04-19 15:33:35 +0200
committerSamy Pesse <samypesse@gmail.com>2016-04-19 15:33:35 +0200
commit61c49839498ef5056b3d8ac1719e87baef6656af (patch)
treebc3eac760b2f0b3b4b45094edd2242a82ab74c3d
parentfb862f466f867d437da5cee7ed52a863901458b8 (diff)
downloadgitbook-61c49839498ef5056b3d8ac1719e87baef6656af.zip
gitbook-61c49839498ef5056b3d8ac1719e87baef6656af.tar.gz
gitbook-61c49839498ef5056b3d8ac1719e87baef6656af.tar.bz2
Fix template context should be global in nunjucks for theming
Fix pdf_footer and pdf_header template not rendering
-rw-r--r--lib/output/website/index.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/output/website/index.js b/lib/output/website/index.js
index 0a8618c..9acc631 100644
--- a/lib/output/website/index.js
+++ b/lib/output/website/index.js
@@ -154,7 +154,9 @@ WebsiteOutput.prototype.renderAsString = function(tpl, context) {
// Calcul template name
var filename = this.templateName(tpl);
- context = _.extend(context, {
+ context = _.extend({
+ template: {}
+ }, context, {
plugins: {
resources: this.resources
},
@@ -165,7 +167,7 @@ WebsiteOutput.prototype.renderAsString = function(tpl, context) {
// Create environment
var env = setupTemplateEnv(this, context);
- return Promise.nfcall(env.render.bind(env), filename, context);
+ return Promise.nfcall(env.render.bind(env), filename);
};
/*