diff options
author | nasirkhan <nasir8891@gmail.com> | 2015-02-27 22:16:11 +0600 |
---|---|---|
committer | nasirkhan <nasir8891@gmail.com> | 2015-02-27 22:16:11 +0600 |
commit | eac513cfa370e1303dcd6ff3842d4f15b9eaf5f4 (patch) | |
tree | 1cdf5d823dc5bd0498cc48a359084949abb6acfb /lib | |
parent | 62c99759c1f3998720179f4230a2210ef6c8f836 (diff) | |
parent | 5ec8a1f18c881a3bc17924ba103241f387eb0289 (diff) | |
download | gitbook-eac513cfa370e1303dcd6ff3842d4f15b9eaf5f4.zip gitbook-eac513cfa370e1303dcd6ff3842d4f15b9eaf5f4.tar.gz gitbook-eac513cfa370e1303dcd6ff3842d4f15b9eaf5f4.tar.bz2 |
Merge remote-tracking branch 'upstream/version/2.0' into version/2.0
Diffstat (limited to 'lib')
-rw-r--r-- | lib/book.js | 2 | ||||
-rw-r--r-- | lib/utils/page.js | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/book.js b/lib/book.js index 6cdc3e6..3912977 100644 --- a/lib/book.js +++ b/lib/book.js @@ -664,7 +664,7 @@ Book.prototype.resolve = function(p) { // Normalize a link to .html and convert README -> index Book.prototype.contentLink = function(link) { if ( - path.basename(link) == "README" + path.basename(link, path.extname(link)) == "README" || link == this.readmeFile ) { link = path.join(path.dirname(link), "index"+path.extname(link)); diff --git a/lib/utils/page.js b/lib/utils/page.js index fce800b..cdc7d1a 100644 --- a/lib/utils/page.js +++ b/lib/utils/page.js @@ -189,8 +189,10 @@ function normalizeHtml(src, options) { if (links.isRelative(href)) { var absolutePath = path.join(options.base, href); - // If is in navigation relative: change extsnio nto be .html - if (options.navigation[absolutePath]) href = links.changeExtension(href, ".html"); + // If is in navigation relative: transform as content + if (options.navigation[absolutePath]) { + href = options.book.contentLink(href); + } // Transform as absolute href = links.toAbsolute(href, options.base, options.output); |