summaryrefslogtreecommitdiffstats
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
parent1e486a16bd9a05db1e9550aad7228765d73e310b (diff)
downloadgitbook-7de152539d7834df62a9579590ed839ef55d2bb5.zip
gitbook-7de152539d7834df62a9579590ed839ef55d2bb5.tar.gz
gitbook-7de152539d7834df62a9579590ed839ef55d2bb5.tar.bz2
Fix order of search paths for nunjucks
-rw-r--r--docs/book.js6
-rw-r--r--lib/output/website.js7
2 files changed, 8 insertions, 5 deletions
diff --git a/docs/book.js b/docs/book.js
index b04e91c..988abb2 100644
--- a/docs/book.js
+++ b/docs/book.js
@@ -1,10 +1,10 @@
var pkg = require('../package.json');
module.exports = {
- "title": "GitBook Documentation",
+ title: 'GitBook Documentation',
- plugins: ["theme-official"],
- theme: "official",
+ plugins: ['theme-official'],
+ theme: 'official',
variables: {
version: pkg.version
}
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) {