Skip to content

Commit d86515c

Browse files
fix: Base URL not rewriting to nextflow in search (#1148)
* Fix base URL
1 parent 70fa7c6 commit d86515c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/client-modules/cross-site-nav.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Captured once so it doesn't drift as client-side nav happens.
77
*/
88
const firstSegment = window.location.pathname.split('/').filter(Boolean)[0];
9-
const PRODUCT_BASE = firstSegment ? `/${firstSegment}/` : '/';
9+
const PRODUCT_BASE = firstSegment ? `/${firstSegment}/` : null;
1010

1111
function isExternalToProduct(rawUrl) {
1212
let url;
@@ -19,6 +19,11 @@
1919
// Ignore different origins — browser handles those natively
2020
if (url.origin !== window.location.origin) return false;
2121

22+
// At root (no product prefix), any navigation into a product sub-path is cross-product
23+
if (!PRODUCT_BASE) {
24+
return url.pathname.split('/').filter(Boolean).length > 0;
25+
}
26+
2227
// Force hard load if the path leaves the current product base
2328
return !url.pathname.startsWith(PRODUCT_BASE);
2429
}

0 commit comments

Comments
 (0)