Skip to content

Commit

Permalink
Improve Markdown page-to-page link processing.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulhibbitts committed May 11, 2023
1 parent 132cc9e commit da7045c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -661,12 +661,13 @@
}
}
// Update Markdown file link
var newURL = ''
var newURL = '';
// Leverage Docsify page-to-page cache if no dynamic URL parameters are present (i.e. edit-link Markdown pages)
if (!(editThisPageLinkURLparm.substr(editThisPageLinkURLparm.length - 3) == '.md' && !(getURLParameterByName('hypothesis')))) {
var isDynamicLink = editThisPageLinkURLparm.substr(-3) === '.md' && !getURLParameterByName('hypothesis');
if (!isDynamicLink) {
newURL = '#/' + lastSegment;
} else {
newURL = url + `?basePath=${currentBasePath}&homepage=${lastSegment}.md` + URLparms + editThisPageLinkURLparm;
newURL = url + '?basePath=' + currentBasePath + '&homepage=' + lastSegment + '.md' + URLparms + editThisPageLinkURLparm;
}
link.setAttribute('href', newURL);
}
Expand Down

0 comments on commit da7045c

Please sign in to comment.