From b751d102f158968aab681cb663d27b4c32197f62 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Tue, 2 Jun 2026 21:48:02 +0300 Subject: feat: add preview update channel --- website/src/components/Header.astro | 149 ++++++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 website/src/components/Header.astro (limited to 'website/src/components/Header.astro') diff --git a/website/src/components/Header.astro b/website/src/components/Header.astro new file mode 100644 index 00000000..982efd2e --- /dev/null +++ b/website/src/components/Header.astro @@ -0,0 +1,149 @@ +--- +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/'); +--- + +
+
+ +
+
+ {isDocs && ( + + )} + {shouldRenderSearch && } +
+
+ + + +
+
+ + -- cgit v1.2.3