diff options
Diffstat (limited to 'lib/generate')
-rw-r--r-- | lib/generate/generator.js | 20 | ||||
-rw-r--r-- | lib/generate/site/index.js | 2 |
2 files changed, 2 insertions, 20 deletions
diff --git a/lib/generate/generator.js b/lib/generate/generator.js index 84c65d7..4791c98 100644 --- a/lib/generate/generator.js +++ b/lib/generate/generator.js @@ -14,9 +14,6 @@ var BaseGenerator = function(options) { this.options.plugins = Plugin.normalizeNames(this.options.plugins); this.options.plugins = _.union(this.options.plugins, this.options.defaultsPlugins); this.plugins = []; - - // Include variables (not yet loaded) - this.variables = {}; }; BaseGenerator.prototype.callHook = function(name, data) { @@ -25,22 +22,7 @@ BaseGenerator.prototype.callHook = function(name, data) { // Sets up generator BaseGenerator.prototype.load = function() { - return this.loadVariables() - .then(this.loadPlugins.bind(this)); -}; - -BaseGenerator.prototype.loadVariables = function() { - var that = this; - - return fs.readFile(path.join(this.options.input, 'variables.json'), 'utf8') - .then(function(content) { - try { - that.variables = JSON.parse(content); - } catch(err) { - console.log('No variables.json'); - } - }) - .fail(function() {}); + return this.loadPlugins(); }; BaseGenerator.prototype.loadPlugins = function() { diff --git a/lib/generate/site/index.js b/lib/generate/site/index.js index 4179917..6d86c7c 100644 --- a/lib/generate/site/index.js +++ b/lib/generate/site/index.js @@ -128,7 +128,7 @@ Generator.prototype.prepareFile = function(content, _input) { // Output directory outdir: path.dirname(_input) || '/', // Templating variables - variables: that.variables, + variables: that.options.variables, }); }) .then(function(sections) { |