docs: handle base path

This commit is contained in:
Jay V
2025-09-04 00:53:45 -07:00
parent 133ae42c55
commit 42b440be0c
2 changed files with 4 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ export default defineConfig({
tag: "link",
attrs: {
rel: "icon",
href: "/favicon.svg",
href: "/docs/favicon.svg",
},
},
],

View File

@@ -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} />
)}