Skip to content

Commit bbf5ab5

Browse files
committed
🐛 Fix lang-toggle.js for live deploy
1 parent 603e8a0 commit bbf5ab5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

guide/theme/lang_toggle.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@
4242
// Fallback: If "book/" isn’t in the path
4343
// Just go to the top-level file in the chosen language.
4444
if (chosenLang === 'en')
45-
window.location.href = 'index.html';
45+
newPath = 'index.html';
4646
else
47-
window.location.href = chosenLang + '/index.html';
47+
newPath = chosenLang + '/index.html';
48+
49+
window.location.href = window.location.hostname + '/' + newPath;
4850

4951
return;
5052
}

0 commit comments

Comments
 (0)