Jay V 5 месяцев назад
Родитель
Сommit
42b440be0c
2 измененных файлов с 4 добавлено и 2 удалено
  1. 1 1
      packages/web/astro.config.mjs
  2. 3 1
      packages/web/src/components/Head.astro

+ 1 - 1
packages/web/astro.config.mjs

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

+ 3 - 1
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} />
 )}