Only process relative links on RTD
This commit is contained in:
parent
30744afd24
commit
f0a240aa46
|
@ -44,12 +44,14 @@ var nodemcu = nodemcu || {};
|
||||||
* replaces the relative path with an absolute path based on the selected branch.
|
* replaces the relative path with an absolute path based on the selected branch.
|
||||||
*/
|
*/
|
||||||
function replaceRelativeLinksWithStaticGitHubUrl() {
|
function replaceRelativeLinksWithStaticGitHubUrl() {
|
||||||
var relativePath = isOnRtd() ? "../../.." : "../..";
|
if (isOnRtd()) {
|
||||||
var gitHubPath = "https://github.com/nodemcu/nodemcu-firmware/tree/" + determineSelectedBranch();
|
var relativePath = "../../..";
|
||||||
var gitHubLinks = $("a[href^='" + relativePath + "']").each(function (index) {
|
var gitHubPath = "https://github.com/nodemcu/nodemcu-firmware/tree/" + determineSelectedBranch();
|
||||||
var url = $(this).attr('href');
|
var gitHubLinks = $("a[href^='" + relativePath + "']").each(function (index) {
|
||||||
$(this).attr('href', url.replace(relativePath, gitHubPath));
|
var url = $(this).attr('href');
|
||||||
});
|
$(this).attr('href', url.replace(relativePath, gitHubPath));
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue