diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-04-04 14:10:56 -0700 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-04-04 14:10:56 -0700 |
commit | 446d486a0fb725f3df76d9b6e8d2bca02042805b (patch) | |
tree | cfd5405f607fcca196ef5bad6b0b88662c30ccb9 /lib/generate | |
parent | 07101deaefb8848d40231eea12a3bf0710e6a78e (diff) | |
download | gitbook-446d486a0fb725f3df76d9b6e8d2bca02042805b.zip gitbook-446d486a0fb725f3df76d9b6e8d2bca02042805b.tar.gz gitbook-446d486a0fb725f3df76d9b6e8d2bca02042805b.tar.bz2 |
Add base for theming
Diffstat (limited to 'lib/generate')
-rw-r--r-- | lib/generate/site/index.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/generate/site/index.js b/lib/generate/site/index.js index ac6ece6..13c7438 100644 --- a/lib/generate/site/index.js +++ b/lib/generate/site/index.js @@ -1,6 +1,7 @@ var util = require("util"); var path = require("path"); var Q = require("q"); +var _ = require("lodash"); var swig = require('swig'); var fs = require("../fs"); @@ -20,8 +21,13 @@ swig.setFilter('mdLink', function(link) { var Generator = function() { BaseGenerator.apply(this, arguments); + // Options + this.options = _.defaults(this.options, { + theme: path.resolve(__dirname, '../../../theme') + }); + // Load base template - this.template = swig.compileFile(path.resolve(__dirname, '../../templates/page.html')); + this.template = swig.compileFile(path.resolve(this.options.theme, 'templates/page.html')); }; util.inherits(Generator, BaseGenerator); @@ -82,7 +88,7 @@ Generator.prototype.finish = function() { ) .then(function() { return fs.copy( - path.join(__dirname, "../../assets/static"), + path.join(that.options.theme, "assets"), path.join(that.options.output, "gitbook") ); }); |