Commit 93ae9b4
authored
feat(seo): lead compare/blog titles with search phrase + stat-led meta descriptions / compare 与博客标题以搜索短语开头并优化 meta 描述 (#598)
* feat(seo): lead compare/blog titles with search phrase, stat-led + trimmed meta descriptions
Improve SERP click-through on page-1 compare pages and blog posts.
- Compare <title> now leads with the GPU pair (the actual query, e.g.
"B200 vs B300: GLM-5 Inference Benchmark | InferenceX") via title.absolute,
bypassing the long root template; falls back "Inference Benchmark"→"Benchmark"
for long pairs. New compareModelSeoName (single natural version name) +
compareSeoTitle in compare-slug.ts.
- Compare meta description is now stat-led from interpolated head-to-head
numbers at the default interactivity target (tok/s/GPU + $/M-tok), ≤155 chars,
gracefully falling back to compact boilerplate for sparse-data pairs.
New compareMetaDescription / computeCompareStat in compare-ssr.ts.
- Blog <title> uses the shorter "| InferenceX" suffix (title.absolute).
- Blog meta/OG/Twitter descriptions use blogDescription = seoDescription ??
smartTruncate(subtitle, 155) (word-boundary cut, no mid-sentence truncation).
Added optional seoDescription frontmatter to 9 long-subtitle posts.
- Mirrored every change on /zh (compareMetaDescriptionZh, zh titles, zh
seoDescription on the 9 translated posts).
- Unit tests for compareModelSeoName, compareSeoTitle, compareMetaDescription
(+ zh structural port), smartTruncate, and blogDescription.
中文:让 /compare 与博客页面的 SEO 元数据以搜索短语开头,提升谷歌搜索结果页点击率。
compare 的 <title> 改为以 GPU 对(真实搜索词,如“B200 vs B300: GLM-5 Inference
Benchmark | InferenceX”)开头,使用 title.absolute 绕过冗长的根模板,长组合时将
“Inference Benchmark”缩短为“Benchmark”;新增 compareModelSeoName(单一自然版本名)
与 compareSeoTitle。compare 的 meta 描述改为在默认交互性目标下由插值出的正面对比
数据(tok/s/GPU 与 $/M-tok)驱动,控制在 155 字符内,数据稀疏时优雅回退到精简样板
文案;新增 compareMetaDescription / computeCompareStat。博客 <title> 改用更短的
“| InferenceX”后缀。博客 meta/OG/Twitter 描述改用 blogDescription =
seoDescription ?? smartTruncate(subtitle, 155)(按词边界截断,避免句中截断),并为
9 篇长副标题文章新增 seoDescription frontmatter。所有改动均在 /zh 侧同步(新增
compareMetaDescriptionZh、中文标题、9 篇译文的中文 seoDescription)。补充相应单元测试。
* fix(seo): sync blog JSON-LD description with meta/OG description
Cursor Bugbot flagged that the BlogPosting JSON-LD description still used
the full meta.subtitle while the HTML meta, OpenGraph, and Twitter
descriptions were routed through blogDescription — so posts with a
seoDescription or long subtitle exposed different text in structured data
than in the SERP/social tags. Route the JSON-LD description through the
same blogDescription helper (EN + zh) so they stay in sync. Logic is
already covered by the blogDescription unit tests.
中文:修复博客 JSON-LD 描述与 meta/OG 描述不一致的问题。Cursor Bugbot 指出
BlogPosting JSON-LD 的 description 仍使用完整的 meta.subtitle,而 HTML meta、
OpenGraph 和 Twitter 描述已改用 blogDescription,导致设置了 seoDescription 或
副标题较长的文章在结构化数据与搜索/社交标签中显示不同文本。这里让 JSON-LD 的
description 同样走 blogDescription(EN 与 zh 两侧),保持一致;相关逻辑已由
blogDescription 单元测试覆盖。1 parent bc30638 commit 93ae9b4
30 files changed
Lines changed: 674 additions & 33 deletions
File tree
- packages/app
- content/blog
- zh
- src
- app
- blog/[slug]
- compare/[slug]
- zh
- blog/[slug]
- compare/[slug]
- lib
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
0 commit comments