Fix GitHub source code link in docs for 'latest' path

This commit is contained in:
Marcel Stör 2016-07-10 00:57:50 +02:00
parent 8394810057
commit 6bb6996d2b
1 changed files with 5 additions and 1 deletions

View File

@ -202,7 +202,11 @@ var nodemcu = nodemcu || {};
if (window.location.origin.indexOf('readthedocs') > -1) { if (window.location.origin.indexOf('readthedocs') > -1) {
// path is like /en/<branch>/<lang>/build/ -> extract 'lang' // path is like /en/<branch>/<lang>/build/ -> extract 'lang'
// split[0] is an '' because the path starts with the separator // split[0] is an '' because the path starts with the separator
branch = path.split('/')[2]; var thirdPathSegment = path.split('/')[2];
// 'latest' is an alias on RTD for the 'dev' branch - which is the default for 'branch' here
if (thirdPathSegment != 'latest') {
branch = thirdPathSegment;
}
} }
return branch; return branch;
} }