summaryrefslogtreecommitdiffstats
path: root/lib/generate/site/index.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-11-01 15:00:13 +0100
committerSamy Pessé <samypesse@gmail.com>2014-11-01 15:00:13 +0100
commit002d685ebb53b7cdf786191688c4077cd0a6d846 (patch)
treeabe9220702d7fecdd27b7dd80e37eaf02a5b8d1d /lib/generate/site/index.js
parent1e4632080b64c7f100c3886454fedab70c7d8909 (diff)
downloadgitbook-002d685ebb53b7cdf786191688c4077cd0a6d846.zip
gitbook-002d685ebb53b7cdf786191688c4077cd0a6d846.tar.gz
gitbook-002d685ebb53b7cdf786191688c4077cd0a6d846.tar.bz2
Adapt include in page parsing to works on clientside
Diffstat (limited to 'lib/generate/site/index.js')
-rw-r--r--lib/generate/site/index.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/generate/site/index.js b/lib/generate/site/index.js
index a62108b..5d2aee6 100644
--- a/lib/generate/site/index.js
+++ b/lib/generate/site/index.js
@@ -123,12 +123,15 @@ Generator.prototype.prepareFile = function(content, _input) {
return parse.page(page.content, {
// Local files path
dir: path.dirname(_input) || '/',
- // Project's include folder
- includes_dir: path.join(that.options.input, '_includes'),
+
// Output directory
outdir: path.dirname(_input) || '/',
- // Templating variables
- variables: that.options.variables,
+
+ // Includer for templating
+ includer: parse.includer(that.options.variables, [
+ path.dirname(_input) || '/',
+ path.join(that.options.input, '_includes'),
+ ], path.join, fs.readFileSync)
});
})
.then(function(sections) {