aboutsummaryrefslogtreecommitdiff
path: root/website/src/components/SiteTitle.astro
diff options
context:
space:
mode:
Diffstat (limited to 'website/src/components/SiteTitle.astro')
-rw-r--r--website/src/components/SiteTitle.astro7
1 files changed, 5 insertions, 2 deletions
diff --git a/website/src/components/SiteTitle.astro b/website/src/components/SiteTitle.astro
index 576e7635..3e5af0a3 100644
--- a/website/src/components/SiteTitle.astro
+++ b/website/src/components/SiteTitle.astro
@@ -1,8 +1,11 @@
---
+import { docsRoute } from '../docs-path';
+
const { siteTitle, siteTitleHref, locale } = Astro.locals.starlightRoute;
-const isPreview = Astro.url.pathname === '/docs/preview/' || Astro.url.pathname.startsWith('/docs/preview/');
+const route = docsRoute(Astro.url.pathname);
const localePrefix = locale ? `/${locale}` : '';
-const docsHref = isPreview ? '/docs/preview/' : `${localePrefix}/docs/`;
+const targetSegment = route.target === 'stable' ? '' : `/${route.target}`;
+const docsHref = `${localePrefix}/docs${targetSegment}/`;
---
<div class="title-row sl-flex">