Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit d2e16ce

Browse files
committed
Fix about urls
1 parent c1fc18c commit d2e16ce

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

_templates/banner.html

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,13 @@
145145
"font-weight": "bold",
146146
"color": "red"
147147
});
148+
updateLinks(lang); // Call updateLinks here to handle specific URL changes.
148149
} else {
149150
$(this).removeClass('active-lang').removeAttr('style');
150151
}
151152
});
152153
}
153154

154-
setActiveLanguage();
155-
156155
function constructNewPath(lang) {
157156
var currentPath = window.location.pathname;
158157
var pathSegments = currentPath.split('/');
@@ -167,13 +166,33 @@
167166
return pathSegments.join('/');
168167
}
169168

169+
function updateLinks(lang) {
170+
// Update the navbar-brand href
171+
var baseUrl = "https://docs.splunk.com/Observability";
172+
if(lang === "ja") {
173+
$(".navbar-brand").attr("href", baseUrl + "/ja/");
174+
} else {
175+
// Default or other languages' behavior
176+
$(".navbar-brand").attr("href", baseUrl);
177+
}
178+
179+
var serviceDescUrl = "https://docs.splunk.com/observability";
180+
if(lang === "ja") {
181+
$("a.nav-link.newnavbar").attr("href", serviceDescUrl + "/ja/get-started/service-description.html");
182+
} else {
183+
$("a.nav-link.newnavbar").attr("href", serviceDescUrl + "/en/get-started/service-description.html");
184+
}
185+
}
186+
170187
$('.lang').click(function() {
171188
var lang = $(this).data('lang');
172189
var newPath = constructNewPath(lang);
173190
window.location.pathname = newPath;
174191

175192
setActiveLanguage();
176193
});
194+
195+
setActiveLanguage();
177196
});
178197
</script>
179198

0 commit comments

Comments
 (0)