Skip to content

Commit 7a830ef

Browse files
committed
Redirect fix
1 parent 9b92465 commit 7a830ef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/deploy-workshop.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,16 @@ jobs:
9595
(function() {
9696
var path = window.location.pathname;
9797
98-
// Match /latest/ or /v{version}/ patterns (e.g., /latest/en/index.html or /v6.13/en/index.html)
99-
var versionPattern = /^\/(latest|v[\d.]+)\/(.*)/;
98+
// Match /observability-workshop/latest/ or /observability-workshop/v{version}/ patterns
99+
var versionPattern = /^\/observability-workshop\/(latest|v[\d.]+)\/(.*)/;
100100
var match = path.match(versionPattern);
101101
102102
if (match) {
103103
// Extract the path after the version (e.g., "en/index.html")
104-
var newPath = '/' + match[2];
104+
var newPath = match[2];
105105
106106
// Preserve query string and hash if present
107-
var newUrl = window.location.origin + '/observability-workshop' + newPath + window.location.search + window.location.hash;
107+
var newUrl = window.location.origin + '/observability-workshop/' + newPath + window.location.search + window.location.hash;
108108
109109
// Redirect to new URL
110110
window.location.replace(newUrl);

0 commit comments

Comments
 (0)