Repository navigation
feat(site): canonical、每页描述、结构化数据与大图分享卡片 - #31
Merged
Merged
Conversation
cursor
Bot
force-pushed
the
cursor/site-seo-share-card-87e4
branch
from
November 22, 2026 15:25
3ad109e to
1941f9e
Compare
This was referenced Nov 22, 2026
- 每页推 <link rel="canonical">,合并 GitHub Pages 下 /x 与 /x.html 的重复 URL - 描述按 frontmatter.description → summary → sourceSummary → 全站描述取值,压成单行、截断到 160 字 - 文章页 og:type=article,全站 og:locale=zh_CN - 首页 WebSite、翻译页 Article(isBasedOn 指向原文)JSON-LD - 全站默认 og:image / twitter:image(public/og.png,由 intro deck 封面补边到 1200×630),twitter:card 改为 summary_large_image
- og.png 改由 intro deck 封面页的 PPTD 源渲染:起点标签「人类 · 设计约束,握住缰绳」挪到锚点右下方,与曲线、圆点不相交,离曲线的距离与另外三个节点标签一致;去掉右下角「档案快照 · 2026-08」。仍是补边、不裁切。works/ 下的演示稿文件不动 - 全站 head 加 twitter:site=@0xdeusyu
deusyu
force-pushed
the
cursor/site-seo-share-card-87e4
branch
from
November 22, 2026 16:18
e3331c8 to
14447c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
对应曝光方案站内第 2、3 项。改动只涉及
.vitepress/config.ts和新增的public/og.png。改了什么
<link rel="canonical">。GitHub Pages 下/x和/x.html都返回 200,只能靠 canonical 合并这两个 URL。frontmatter.description、summary、sourceSummary,都没有就用全站描述。结果写回pageData.description,所以<meta name="description">和og:description用的是同一个值。描述会合并成单行,超过 160 字截断并补…。website,其余页面article;全站加og:locale=zh_CN。WebSite。翻译页(works/*-translation.md)输出Article:inLanguage: zh-CN,dateModified取 git 时间,isBasedOn由sourceTitle、sourceUrl、sourceAuthor、sourcePublishedAt、sourceLanguage生成。JSON 里的<已转义,避免提前闭合<script>。og:image和twitter:image都指向/og.png,并加上宽高和 alt;twitter:card从summary改为summary_large_image;按你的决定加了twitter:site=@0xdeusyu。分享图
public/og.png是 1200×630 的真实文件,不是 symlink(C14)。它按演示稿封面页(works/harness-engineering-intro-deck/deck/pages/01_cover.page,PPTD YAML)的版式,在 1200×630 的比例上原生重排,再用 open-kimi-ppt 的官方渲染导出:演示稿封面同样的压线问题在 #33 里修复;这个 PR 不改
works/。og 图
效果与局限
summary。concepts、thinking 等页面没有description或summary字段,仍然用全站描述。要让它们也有单独描述,需要给内容文件补 frontmatter,不在这个 PR 的范围里。验证
bash scripts/check-consistency.sh:全部通过,包括 C14(站点源码里没有裸计数)。node .vitepress/sidebar.mjs --verify:通过。npm run docs:build和node scripts/verify-dist.mjs:通过,72 页和.md副本一一对应,产物里没有 symlink;dist/og.png和public/og.png逐字节一致。concepts/00-overview、原创长文的<head>:canonical、og:type、twitter:card各只出现一次,值都正确;JSON-LD 能解析。冲突说明
动手前查过:本仓库没有 translate-book 那边的页脚/README PR。这个 PR 也没有改
themeConfig.footer和 README,之后那边改页脚不会和这里冲突。To show artifacts inline, enable in settings.