diff --git a/CHANGELOG.md b/CHANGELOG.md index 33bbfa3..755490b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ All notable changes to this project will be documented in this file. ### Changed +- **Page-Specific SEO Descriptions**: Add metadata for CLA, security, community values, and blog tag pages, with bilingual policy-page descriptions - **Astro 6 → 7 Major Upgrade**: `astro` ^6.4.8 → ^7.1.3, `@astrojs/vercel` ^10.0.8 → ^11.0.3, `@astrojs/mdx` ^6.0.3 → ^7.0.3 (Astro 7 ships with Vite 8 + Rolldown, stricter SSR static-build validation) - **astro-compress Upgrade**: ^2.3.8 → ^2.4.1 (picks up svgo 4.x, sharp 0.34.x) - **npm overrides Update**: Added `"svgo": ">=4.0.2"` and `"sharp": "^0.35.3"` overrides to force transitive dependencies to safe versions; removed conflicting `"vite": "^7"` override (Astro 7 requires Vite 8) diff --git a/src/layouts/MarkdownLayout.astro b/src/layouts/MarkdownLayout.astro index 49ba81c..c7199a0 100644 --- a/src/layouts/MarkdownLayout.astro +++ b/src/layouts/MarkdownLayout.astro @@ -7,13 +7,17 @@ export interface Props { frontmatter: { title?: string; titleEn?: string; + description?: string; + descriptionEn?: string; }; } const { frontmatter } = Astro.props; +const description = [frontmatter?.description, frontmatter?.descriptionEn].filter(Boolean).join(' - '); const metadata: MetaData = { title: frontmatter?.title, + description: description || undefined, }; --- diff --git a/src/pages/[...blog]/[tag]/[...page].astro b/src/pages/[...blog]/[tag]/[...page].astro index fac3b5b..e5db30b 100644 --- a/src/pages/[...blog]/[tag]/[...page].astro +++ b/src/pages/[...blog]/[tag]/[...page].astro @@ -20,6 +20,7 @@ const lastPage = page.lastPage ?? 1; const total = page.total ?? page.data.length; const metadata = { + description: `Posts tagged '${tag.title}' - articles from the iFLYTEK open source blog.`, title: `标签:${tag.title}${currentPage > 1 ? ` — 第 ${currentPage} 页` : ''}`, robots: { index: blogTagRobots?.index, diff --git a/src/pages/cla.astro b/src/pages/cla.astro index 390f346..55addd2 100644 --- a/src/pages/cla.astro +++ b/src/pages/cla.astro @@ -2,7 +2,15 @@ import MarkdownLayout from '~/layouts/MarkdownLayout.astro'; --- - +

diff --git a/src/pages/security.astro b/src/pages/security.astro index 6a4d643..eeff4f5 100644 --- a/src/pages/security.astro +++ b/src/pages/security.astro @@ -2,7 +2,14 @@ import MarkdownLayout from '~/layouts/MarkdownLayout.astro'; --- - +

如果你在本项目中发现安全问题,请遵循以下指南。

diff --git a/src/pages/values.astro b/src/pages/values.astro index 7151f27..d5ae409 100644 --- a/src/pages/values.astro +++ b/src/pages/values.astro @@ -2,7 +2,14 @@ import MarkdownLayout from '~/layouts/MarkdownLayout.astro'; --- - +

科大讯飞开源社区建立在我们共同遵循的价值观之上,这些价值观指引着我们的互动、决策与成长。