summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/book.js9
-rw-r--r--lib/generators/website.js2
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/book.js b/lib/book.js
index bdd4dfc..42e2c23 100644
--- a/lib/book.js
+++ b/lib/book.js
@@ -675,8 +675,8 @@ Book.prototype.resolve = function(p) {
return path.resolve(this.root, p);
};
-// Normalize a link to .html and convert README -> index
-Book.prototype.contentLink = function(link) {
+// Normalize a path to .html and convert README -> index
+Book.prototype.contentPath = function(link) {
if (
path.basename(link, path.extname(link)) == "README"
|| link == this.readmeFile
@@ -688,6 +688,11 @@ Book.prototype.contentLink = function(link) {
return link;
}
+// Normalize a link to .html and convert README -> index
+Book.prototype.contentLink = function(link) {
+ return links.normalize(this.contentPath(link));
+}
+
// Index a page into the search index
Book.prototype.indexPage = function(page) {
var nav = this.navigation[page.path];
diff --git a/lib/generators/website.js b/lib/generators/website.js
index d1e92a0..9405a1c 100644
--- a/lib/generators/website.js
+++ b/lib/generators/website.js
@@ -136,7 +136,7 @@ Generator.prototype.convertFile = function(input) {
}
})
.then(function(page) {
- var relativeOutput = that.book.contentLink(page.path);
+ var relativeOutput = that.book.contentPath(page.path);
var output = path.join(that.options.output, relativeOutput);
var basePath = path.relative(path.dirname(output), that.options.output) || ".";