summaryrefslogtreecommitdiffstats
path: root/lib/generate/site/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/generate/site/index.js')
-rw-r--r--lib/generate/site/index.js23
1 files changed, 19 insertions, 4 deletions
diff --git a/lib/generate/site/index.js b/lib/generate/site/index.js
index 9d738be..eaba6ee 100644
--- a/lib/generate/site/index.js
+++ b/lib/generate/site/index.js
@@ -30,13 +30,28 @@ var Generator = function() {
this.revision = Date.now();
this.indexer = indexer();
-
- // Load base template
- this.template = swig.compileFile(path.resolve(this.options.theme, 'templates/site.html'));
- this.langsTemplate = swig.compileFile(path.resolve(this.options.theme, 'templates/langs.html'));
};
util.inherits(Generator, BaseGenerator);
+// Load all templates
+Generator.prototype.loadTemplates = function() {
+ this.template = swig.compileFile(
+ this.plugins.template("site") || path.resolve(this.options.theme, 'templates/site.html')
+ );
+ this.langsTemplate = swig.compileFile(
+ this.plugins.template("langs") || path.resolve(this.options.theme, 'templates/langs.html')
+ );
+};
+
+// Load plugins
+Generator.prototype.loadPlugins = function() {
+ var that = this;
+
+ return BaseGenerator.prototype.loadPlugins.apply(this)
+ .then(function() {
+ return that.loadTemplates();
+ });
+};
// Generate a template
Generator.prototype._writeTemplate = function(tpl, options, output) {