Skip to content

Commit c23b401

Browse files
committed
FIX: 404 on the Documentation link when on home page.
1 parent fa10a70 commit c23b401

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

templates/switchers.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,16 @@
137137
}
138138

139139
function create_placeholders_if_missing() {
140+
var version_segment = version_segment_in_url(window.location.href);
141+
var language_segment = language_segment_from_url(window.location.href);
142+
var index = "/" + language_segment + version_segment;
143+
140144
if ($('.version_switcher_placeholder').length)
141145
return;
142146

143147
var html = '<span class="language_switcher_placeholder"></span> \
144148
<span class="version_switcher_placeholder"></span> \
145-
<a href="../index.html">Documentation</a> &#187;';
149+
<a href="/" id="indexlink">Documentation</a> &#187;';
146150

147151
var probable_places = [
148152
"body>div.related>ul>li:not(.right):contains('Documentation'):first",
@@ -153,6 +157,7 @@
153157
var probable_place = $(probable_places[i]);
154158
if (probable_place.length == 1) {
155159
probable_place.html(html);
160+
document.getElementById('indexlink').href = index;
156161
return;
157162
}
158163
}

0 commit comments

Comments
 (0)