--- import config from 'virtual:starlight/user-config'; import LanguageSelect from 'virtual:starlight/components/LanguageSelect'; import Search from 'virtual:starlight/components/Search'; import SiteTitle from 'virtual:starlight/components/SiteTitle'; import SocialIcons from 'virtual:starlight/components/SocialIcons'; import ThemeSelect from 'virtual:starlight/components/ThemeSelect'; const shouldRenderSearch = config.pagefind || config.components.Search !== '@astrojs/starlight/components/Search.astro'; const pathname = Astro.url.pathname; const isDocs = pathname === '/docs/' || pathname.startsWith('/docs/'); const isPreview = pathname === '/docs/preview/' || pathname.startsWith('/docs/preview/'); const stableHref = isPreview ? pathname.replace(/^\/docs\/preview\/?/, '/docs/') : pathname; const previewHref = isPreview ? pathname : pathname === '/docs/' ? '/docs/preview/' : pathname.replace(/^\/docs\/?/, '/docs/preview/'); ---