@@ -6,7 +6,7 @@ import { getMDXComponents } from '../../components/docs/mdx'
66import { findNeighbour } from 'fumadocs-core/page-tree'
77import type { Metadata } from 'next'
88import type { Root , Node } from 'fumadocs-core/page-tree'
9- import { siteConfig , themeConfig } from '@/lib/theme-config'
9+ import { getSiteUrl } from '@/lib/theme-config'
1010
1111interface PageProps {
1212 params : Promise < { slug ?: string [ ] } >
@@ -108,7 +108,9 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
108108 const description = page . data . description
109109
110110 // Build OG image URL with query params
111- const ogImageUrl = new URL ( `${ siteConfig . url } /api/og` )
111+ // getSiteUrl() auto-detects Vercel deployments
112+ const baseUrl = getSiteUrl ( )
113+ const ogImageUrl = new URL ( `${ baseUrl } /api/og` )
112114 ogImageUrl . searchParams . set ( 'title' , title )
113115 ogImageUrl . searchParams . set ( 'section' , section )
114116
@@ -119,7 +121,7 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
119121 title,
120122 description,
121123 type : 'article' ,
122- url : `${ siteConfig . url } ${ page . url } ` ,
124+ url : `${ baseUrl } ${ page . url } ` ,
123125 images : [
124126 {
125127 url : ogImageUrl . toString ( ) ,
0 commit comments