Skip to content

Commit f7fcf72

Browse files
refactor(blog): remove i18n controls from page title component
Remove BlogI18nControls and related blog locale logic from StarlightPageTitle.astro, cleaning up unused imports and conditional rendering of the blog language switcher. Co-Authored-By: Hagicode <noreply@hagicode.com> Signed-off-by: newbe36524 <newbe36524@qq.com>
1 parent 7d07d56 commit f7fcf72

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

src/components/StarlightPageTitle.astro

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
---
22
import DocsEditLink from "./DocsEditLink.astro";
3-
import BlogI18nControls from "./BlogI18nControls.astro";
4-
import { stripBlogLocalePrefix } from "../lib/blog-i18n";
53
64
const PAGE_TITLE_ID = "_top";
7-
const route = Astro.locals.starlightRoute;
8-
const routeLocale = route.locale ?? "root";
9-
const normalizedId = stripBlogLocalePrefix(`/${route.id}`).replace(/^\/+/, "");
10-
const blogPostMatch = normalizedId.match(/^blog\/(\d{4}-\d{2}-\d{2}-[^/]+)$/);
11-
const isBlogIndex = normalizedId === "blog";
125
---
136

147
<div class="docs-page-title">
158
<h1 id={PAGE_TITLE_ID}>{Astro.locals.starlightRoute.entry.data.title}</h1>
169
<DocsEditLink placement="header" />
1710
</div>
18-
{(isBlogIndex || blogPostMatch) && (
19-
<BlogI18nControls routeLocale={routeLocale} slug={blogPostMatch?.[1]} />
20-
)}
2111

2212
<style>
2313
@layer starlight.core {

0 commit comments

Comments
 (0)