From 6bb6996d2b99c51ff1664e43c31ace07ae168f5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20St=C3=B6r?= Date: Sun, 10 Jul 2016 00:57:50 +0200 Subject: [PATCH] Fix GitHub source code link in docs for 'latest' path --- docs/js/extra.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/js/extra.js b/docs/js/extra.js index a6816960..fef3df6c 100644 --- a/docs/js/extra.js +++ b/docs/js/extra.js @@ -202,7 +202,11 @@ var nodemcu = nodemcu || {}; if (window.location.origin.indexOf('readthedocs') > -1) { // path is like /en///build/ -> extract 'lang' // 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; }