diff --git a/website/astro.config.mjs b/website/astro.config.mjs index 84a89b33..a192c4ab 100644 --- a/website/astro.config.mjs +++ b/website/astro.config.mjs @@ -122,7 +122,7 @@ export default defineConfig({ }), ], site, - base, + base: base, vite: { ssr: { // Example: Force a broken package to skip SSR processing, if needed diff --git a/website/src/components/HeadCommon.astro b/website/src/components/HeadCommon.astro index 2aa6acfe..724c4b07 100644 --- a/website/src/components/HeadCommon.astro +++ b/website/src/components/HeadCommon.astro @@ -4,6 +4,7 @@ import '../styles/index.css'; const { BASE_URL } = import.meta.env; const base = BASE_URL; +const baseNoTrailing = base.endsWith('/') ? base.slice(0, -1) : base; --- @@ -11,20 +12,20 @@ const base = BASE_URL; - + - - + + - + diff --git a/website/src/components/Header/Header.astro b/website/src/components/Header/Header.astro index 4cee4282..b429fdb1 100644 --- a/website/src/components/Header/Header.astro +++ b/website/src/components/Header/Header.astro @@ -16,6 +16,10 @@ const { currentPage } = Astro.props as Props; // const lang = getLanguageFromURL(currentPage); const langCode = 'en'; // getLanguageFromURL(currentPage); const sidebar = SIDEBAR[langCode]; + +const { BASE_URL } = import.meta.env; +const base = BASE_URL; +const baseNoTrailing = base.endsWith('/') ? base.slice(0, -1) : base; ---