Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
f0a240aa
Commit
f0a240aa
authored
Feb 11, 2019
by
Marcel Stör
Browse files
Only process relative links on RTD
parent
30744afd
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/js/extra.js
View file @
f0a240aa
...
@@ -44,12 +44,14 @@ var nodemcu = nodemcu || {};
...
@@ -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
));
});
}
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment