mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-01 22:10:23 +00:00
docs: handle base path
This commit is contained in:
parent
133ae42c55
commit
42b440be0c
2 changed files with 4 additions and 2 deletions
|
|
@ -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} />
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue