From 781a2d7843a2d2267eec66e7ad7487eca2caac0f Mon Sep 17 00:00:00 2001 From: Olivier Koko Date: Tue, 7 Oct 2025 14:32:57 +0200 Subject: [PATCH] fix: redirect under prefix and related project links --- src/MainPage.vue | 3 ++- src/components/Description.vue | 1 + src/components/StacLink.vue | 12 ++++-------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/MainPage.vue b/src/MainPage.vue index 9a586559..b0d69f41 100644 --- a/src/MainPage.vue +++ b/src/MainPage.vue @@ -187,7 +187,8 @@ export default defineComponent({ const match = search.match(regex); if(match){ const redirectContent = decodeURIComponent(match[1]); - const url = new URL(`${window.origin}${this.pathPrefix.replace('.', '')}#/${redirectContent}`); + const {pathname: browserPathname} = window.location; + const url = new URL(`${window.origin}${browserPathname}#/${redirectContent}`); window.location.replace(url.toString()); } } diff --git a/src/components/Description.vue b/src/components/Description.vue index 27152bd0..b5b2d4e3 100644 --- a/src/components/Description.vue +++ b/src/components/Description.vue @@ -48,6 +48,7 @@ export default { #stac-browser .styled-description { line-height: 1.4em; + overflow-x: clip; h1, h2, h3, h4, h5, h6 { color: map-get($theme-colors, "primary"); diff --git a/src/components/StacLink.vue b/src/components/StacLink.vue index 36c20de7..e9c16f44 100644 --- a/src/components/StacLink.vue +++ b/src/components/StacLink.vue @@ -89,7 +89,8 @@ export default { if (this.isStacBrowserLink || this.button) { let obj = { to: this.href, - rel: this.rel + rel: this.rel, + href: this.href }; if (Utils.isObject(this.button)) { Object.assign(obj, this.button); @@ -107,7 +108,7 @@ export default { if (this.button) { return 'b-button'; } - return this.isStacBrowserLink ? 'router-link' : 'a'; + return 'a'; }, href() { if (this.stac || this.isStacBrowserLink) { @@ -121,12 +122,7 @@ export default { } if (!href.startsWith('/')) { const {pathname} = window.location; - if(pathname !== '/' && pathname !== this.pathPrefix ){ - href = pathname + href; - }else{ - href = '/' + href; - } - + href = `${pathname}#/${href}`; } // Add private query parameters to links: https://github.com/radiantearth/stac-browser/issues/142