summaryrefslogtreecommitdiffstats
path: root/lib/output/website.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2016-02-21 19:08:39 +0100
committerSamy Pessé <samypesse@gmail.com>2016-02-21 19:08:39 +0100
commit7de152539d7834df62a9579590ed839ef55d2bb5 (patch)
tree2c30dca9a2cc4d10948626e5e40696804c723552 /lib/output/website.js
parent1e486a16bd9a05db1e9550aad7228765d73e310b (diff)
downloadgitbook-7de152539d7834df62a9579590ed839ef55d2bb5.zip
gitbook-7de152539d7834df62a9579590ed839ef55d2bb5.tar.gz
gitbook-7de152539d7834df62a9579590ed839ef55d2bb5.tar.bz2
Fix order of search paths for nunjucks
Diffstat (limited to 'lib/output/website.js')
-rw-r--r--lib/output/website.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/output/website.js b/lib/output/website.js
index 01021e5..d35ece3 100644
--- a/lib/output/website.js
+++ b/lib/output/website.js
@@ -60,6 +60,10 @@ WebsiteOutput.prototype.prepare = function() {
throw new Error('Theme "' + themeName + '" is not installed, add "' + themeID(themeName) + '" to your "book.json"');
}
+ if (that.themeDefault.root != that.theme.root) {
+ that.log.info.ln('build using theme "' + themeName + '"');
+ }
+
// This list is ordered to give priority to templates in the book
var searchPaths = _.chain([
// The book itself can contains a "_layouts" folder
@@ -76,14 +80,13 @@ WebsiteOutput.prototype.prepare = function() {
.value();
// Load i18n
- _.each(searchPaths.reverse(), function(searchPath) {
+ _.each(searchPaths.concat().reverse(), function(searchPath) {
var i18nRoot = path.resolve(searchPath, '_i18n');
if (!fs.existsSync(i18nRoot)) return;
that.i18n.load(i18nRoot);
});
-
that.env = new nunjucks.Environment(new nunjucks.FileSystemLoader(_.map(searchPaths, templatesPath)));
that.env.addFilter('t', function(s) {