useSite returns the serialized site configuration from rspress.config.ts.
useSite
rspress.config.ts
() => { site: SiteData }
Here is an example of getting the title configuration from rspress.config.ts:
import { useSite } from '@rspress/core/runtime'; export default function SiteTitle() { const { site } = useSite(); return <span>{site.title}</span>; }
Can be used together with usePage to get both global site configuration and current page metadata.
usePage