diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 88b8b0bb..e4116184 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -1,6 +1,7 @@ // @ts-check import { defineConfig } from 'astro/config'; import starlight from '@astrojs/starlight'; +import { siteLinks } from './src/site-links.ts'; // https://astro.build/config export default defineConfig({ @@ -59,8 +60,10 @@ export default defineConfig({ { label: 'FAQ', slug: 'faq' }, { label: 'Known Issues', slug: 'knownissues' }, { label: 'Contributing', slug: 'contributing' }, + { label: siteLinks.forums.label, link: siteLinks.forums.href, attrs: { target: '_blank', rel: 'noreferrer' } }, ], }, + { label: siteLinks.store.label, link: siteLinks.store.href, attrs: { target: '_blank', rel: 'noreferrer' } }, ], }), ], diff --git a/docs/src/components/Header.astro b/docs/src/components/Header.astro index 9a5007b8..faf02ea0 100644 --- a/docs/src/components/Header.astro +++ b/docs/src/components/Header.astro @@ -6,10 +6,15 @@ 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 { Icon } from '@astrojs/starlight/components'; +import { siteLinks } from '../site-links'; // 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'; + +// Pages with a sidebar already have Starlight's own mobile menu toggle; only splash pages need this one. +const { hasSidebar } = Astro.locals.starlightRoute; ---
@@ -17,9 +22,36 @@ const shouldRenderSearch =
- {/* Search box. */} -
- {shouldRenderSearch && } +
+ {/* Search box. */} +
+ {shouldRenderSearch && } +
+ { + !hasSidebar && ( + + ) + }
{/* Right-side group: nav links, social icons, theme/language pickers. */}
@@ -43,10 +75,10 @@ const shouldRenderSearch =
- Store + {siteLinks.store.label}
+ + diff --git a/docs/src/site-links.ts b/docs/src/site-links.ts new file mode 100644 index 00000000..dc2f31aa --- /dev/null +++ b/docs/src/site-links.ts @@ -0,0 +1,5 @@ +// Shared external links, so astro.config.mjs and Header.astro can't drift out of sync. +export const siteLinks = { + store: { label: 'Store', href: 'https://christitus.com/downloads/' }, + forums: { label: 'Forums', href: 'https://forum.christitus.com/' }, +} as const;