Skip to content

Commit 4ab650d

Browse files
committed
Fix current url path
1 parent 395f342 commit 4ab650d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/_static/javascripts/version_dropdown.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ function add_version_dropdown(json_loc, target_loc, text) {
1313
for (var key in versions) {
1414
if (versions.hasOwnProperty(key)) {
1515
console.log(key, versions[key]);
16+
var currentURL = window.location.href;
17+
var path = currentURL.split( versions[key] )[ 1 ];
1618
var a = document.createElement("a");
1719
a.innerHTML = key;
1820
a.title = key;
19-
a.href = target_loc + versions[key] + "/{{ pagename }}.html";
21+
a.href = target_loc + versions[key] + path;
2022
console.log('----', a.href);
2123
content.appendChild(a);
2224
}

0 commit comments

Comments
 (0)