summaryrefslogtreecommitdiffstats
path: root/lib/generate/page
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-22 17:45:12 +0200
committerSamy Pessé <samypesse@gmail.com>2014-04-22 17:45:12 +0200
commit305f2210773c6f6e798d2443a28de95cc8b7bfb2 (patch)
tree632921a4696471b112eda54f6050091e3bbc09f6 /lib/generate/page
parent53514f2602029d61106e1214790fddf072bf9a81 (diff)
downloadgitbook-305f2210773c6f6e798d2443a28de95cc8b7bfb2.zip
gitbook-305f2210773c6f6e798d2443a28de95cc8b7bfb2.tar.gz
gitbook-305f2210773c6f6e798d2443a28de95cc8b7bfb2.tar.bz2
Fix #136: replace links to .md by links to .html
Add more tests for links in page
Diffstat (limited to 'lib/generate/page')
-rw-r--r--lib/generate/page/index.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/generate/page/index.js b/lib/generate/page/index.js
index 3ee368f..c2f4484 100644
--- a/lib/generate/page/index.js
+++ b/lib/generate/page/index.js
@@ -25,14 +25,18 @@ swig.setFilter('code', function(code, lang) {
var Generator = function() {
BaseGenerator.apply(this, arguments);
- // Load base template
- this.template = swig.compileFile(path.resolve(this.options.theme, 'templates/page.html'));
-
// List of pages content
this.pages = {};
};
util.inherits(Generator, BaseGenerator);
+// Load all templates
+Generator.prototype.loadTemplates = function() {
+ this.template = swig.compileFile(
+ this.plugins.template("page") || path.resolve(this.options.theme, 'templates/page.html')
+ );
+};
+
Generator.prototype.convertFile = function(content, input) {
var that = this;
var json = {
@@ -46,6 +50,7 @@ Generator.prototype.convertFile = function(content, input) {
repo: that.options.githubId,
dir: path.dirname(input) || '/',
outdir: './',
+ singleFile: true
});
})
.then(function(sections) {