diff options
| author | Jay V <[email protected]> | 2025-09-04 00:53:45 -0700 |
|---|---|---|
| committer | Jay V <[email protected]> | 2025-09-04 00:53:45 -0700 |
| commit | 42b440be0c63e3b7937799aea839086c6808e37b (patch) | |
| tree | b14872f9041c47070a04bdcb302f3eb8ab9ba60a | |
| parent | 133ae42c55e88d6fb215516ef9cb3616517c299c (diff) | |
| download | opencode-42b440be0c63e3b7937799aea839086c6808e37b.tar.gz opencode-42b440be0c63e3b7937799aea839086c6808e37b.zip | |
docs: handle base path
| -rw-r--r-- | packages/web/astro.config.mjs | 2 | ||||
| -rw-r--r-- | packages/web/src/components/Head.astro | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/packages/web/astro.config.mjs b/packages/web/astro.config.mjs index ec3131a34..02ea4fe16 100644 --- a/packages/web/astro.config.mjs +++ b/packages/web/astro.config.mjs @@ -43,7 +43,7 @@ export default defineConfig({ tag: "link", attrs: { rel: "icon", - href: "/favicon.svg", + href: "/docs/favicon.svg", }, }, ], diff --git a/packages/web/src/components/Head.astro b/packages/web/src/components/Head.astro index f6166f58f..0eaf115b5 100644 --- a/packages/web/src/components/Head.astro +++ b/packages/web/src/components/Head.astro @@ -4,6 +4,8 @@ import type { Props } from '@astrojs/starlight/props' import Default from '@astrojs/starlight/components/Head.astro' import config from '../../config.mjs' +const base = import.meta.env.BASE_URL.slice(1) + const slug = Astro.url.pathname.replace(/^\//, "").replace(/\/$/, ""); const { entry: { @@ -42,7 +44,7 @@ if (isDocs) { <Default {...Astro.props}><slot /></Default> -{ (isDocs || !slug.startsWith("s")) && ( +{ (!slug.startsWith(`${base}/s`)) && ( <meta property="og:image" content={ogImage} /> <meta property="twitter:image" content={ogImage} /> )} |
