diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 3d8764d3b..b428a280b 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -75,6 +75,8 @@ export default defineConfig({ ], components: { MarkdownContent: './src/components/MarkdownContent.astro', + Header: './src/components/Header.astro', + MobileMenuFooter: './src/components/MobileMenuFooter.astro' }, }), ], diff --git a/docs/src/components/Header.astro b/docs/src/components/Header.astro new file mode 100644 index 000000000..48a005fd0 --- /dev/null +++ b/docs/src/components/Header.astro @@ -0,0 +1,87 @@ +--- +import config from 'virtual:starlight/user-config' +import type { Props } from '@astrojs/starlight/props' + +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' + +import VersionSelector from './VersionSelector.astro' + +/** + * Render the `Search` component if Pagefind is enabled or the default search component has been overridden. + */ +const shouldRenderSearch = config.pagefind || config.components.Search !== '@astrojs/starlight/components/Search.astro' +--- + +