Skip to content
This repository was archived by the owner on Oct 27, 2020. It is now read-only.

Commit 3b6667d

Browse files
committed
Merge pull request #2 from aniav/master
Add support for multilingual gitbooks
2 parents 3cc6df8 + fc25dc9 commit 3b6667d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
var path = require('path');
2+
13
module.exports = {
24
hooks: {
35
// After html generation
@@ -12,7 +14,9 @@ module.exports = {
1214
config.label = "Edit This Page";
1315
}
1416

15-
rtEditLink = '<a href="' + config.base + '/' + page.path + '" class="btn fa fa-edit pull-left">&nbsp;&nbsp;' + config.label + '</a>';
17+
newPath = path.relative(this.options.originalInput, page.rawPath);
18+
19+
rtEditLink = '<a href="' + config.base + '/' + newPath + '" class="btn fa fa-edit pull-left">&nbsp;&nbsp;' + config.label + '</a>';
1620

1721
page.content = page.content.replace (
1822
'<!-- Actions Right -->',

0 commit comments

Comments
 (0)