diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-17 15:18:49 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-17 15:18:49 +0100 |
commit | 40cdc285b613949347f2909d8f7027fc51b0db7f (patch) | |
tree | 2819da32f7b619e11267a28a910159c6f1e74859 /lib | |
parent | 46f017e68bd919c365311a78d02252a451afdc04 (diff) | |
download | gitbook-40cdc285b613949347f2909d8f7027fc51b0db7f.zip gitbook-40cdc285b613949347f2909d8f7027fc51b0db7f.tar.gz gitbook-40cdc285b613949347f2909d8f7027fc51b0db7f.tar.bz2 |
Don't build context in templating engine
Diffstat (limited to 'lib')
-rw-r--r-- | lib/template/index.js | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/lib/template/index.js b/lib/template/index.js index 8266572..bb8272c 100644 --- a/lib/template/index.js +++ b/lib/template/index.js @@ -6,7 +6,6 @@ var escapeStringRegexp = require('escape-string-regexp'); var Promise = require('../utils/promise'); var error = require('../utils/error'); -var gitbook = require('../gitbook'); var defaultBlocks = require('./blocks'); var Loader = require('./loader'); @@ -345,29 +344,10 @@ TemplateEngine.prototype.render = function(content, context, options) { path: null }); - // Setup context for the template - context = _.extend({}, context, { - // Variables from book.json - book: this.book.config.get('variables'), - - // Complete book.json - config: this.book.config.dump(), - - // infos about gitbook - gitbook: { - version: gitbook.version, - generator: this.book.config.get('generator') - } - }); - // Setup path and type if (options.path) { options.path = this.book.resolve(options.path); } - if (!context.type && options.path) { - var parser = parsers.get(path.extname(options.path)); - context.type = parser? parser.name : null; - } // Replace shortcuts content = this.applyShortcuts(options.type, content); |