fix(docs): 修回 33 篇中文文档被机翻毁掉的 title - #396
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes incorrect/machine-translated frontmatter title values across a batch of Chinese LeetCode docs so that page <h1>, <title>, sitemap/search indexing, and /llms.txt indexing reflect accurate Chinese titles.
Changes:
- Corrected 33 docs’ frontmatter
titlevalues (mostly restoring from existingdescriptionor filename), including fixing cases where.mdwas mistakenly included or where YAML folded scalars broke the title. - Normalized titles to consistently include the problem number + correct Chinese name where applicable.
- Updated
generated/doc-contributors.json’sgeneratedAttimestamp.
Reviewed changes
Copilot reviewed 33 out of 34 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
content/docs/career/interview-prep/leetcode/1004_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/1234. 替换子串得到平衡字符串_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/142.环形链表II_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/1653. 使字符串平衡的最少删除次数_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/1664生成平衡数组的方案数_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/1825求出 MK 平均值_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/1828统计一个圆中点的数目_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/219_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/2293_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/2299强密码检验器II_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/2309兼具大小写的最好英文字母_translated.md |
Fix broken folded-scalar title to single-line Chinese |
content/docs/career/interview-prep/leetcode/2335. 装满杯子需要的最短总时长_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/2341. 数组能形成多少数对_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/2639. 查询网格图中每一列的宽度_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/2679.矩阵中的和_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/3072. 将元素分配到两个数组中 II_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/345. 反转字符串中的元音字母_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/538.把二叉搜索树转换为累加树_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/6323. 将钱分给最多的儿童_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/76最小覆盖子串_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/80_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/9021_TUT_3_25T1.md |
Remove .md suffix from title value |
content/docs/career/interview-prep/leetcode/994.腐烂的橘子_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/Counting Stars-Inter-Uni Programming Contest.md |
Remove .md suffix from title value |
content/docs/career/interview-prep/leetcode/[121]买卖股票的最佳时期_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/[1333]餐厅过滤器_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/[146]LRU 缓存_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/[213]打家劫舍 II_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/[2490]回环句_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/[2562]找出数组的串联值_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/[2582]递枕头_translated.md |
Fix frontmatter title to correct Chinese |
content/docs/career/interview-prep/leetcode/brief_alternate 作业帮忙_translated.md |
Remove incorrect English/misleading title and restore proper one |
content/docs/career/interview-prep/leetcode/剑指 Offer II 021. 删除链表的倒数第 n 个结点_translated.md |
Fix frontmatter title to correct Chinese |
generated/doc-contributors.json |
Refresh generated timestamp metadata |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
这批文档的 frontmatter title 是早期机翻残留,正文是中文、标题却是 乱码英文,最离谱的几个: 213.Hiccup II → 213. 打家劫舍 II(打嗝…) Sword finger Offer II 021. … → 剑指 Offer II 021. 删除链表的倒数第 n 个结点 2679.In the matrix and the harmony.md → 2679. 矩阵中的和 76Minimum cover string.md → 76. 最小覆盖子串 title 是页面 <h1> 和 <title>、sitemap.xml、站内搜索索引、以及新加的 /llms.txt 索引的取值来源,所以这批坏标题同时在坑人和坑搜索/AI 抓取。 还有一批标题干脆把文件名连 .md 后缀一起塞了进去。 正确标题不用外部查询,仓库自己就有: - 30 篇的 description 已经写成 "LeetCode <编号>. <中文标题> 题解 — …" (lib/seo-description.ts 那轮补全的产物),直接从里面取 - 3 篇从文件名里的中文还原 description 比文件名更可信:[121] 那篇文件名写的是"最佳时期", description 里是官方译名"最佳时机",取了后者。 只改 title,其余 frontmatter(docId / abbrlink / tags / date)一个字节没动, .en.md 英文版保持英文标题不动。33 篇全部通过 YAML 解析校验。 注:这些文件的正文同样是机翻残留("Today's daily question is too difficult, So find the problem by yourself。"),且部分与 .en.md 重复;那是另一件事, 本次不碰。
longsizhuo
force-pushed
the
fix/zh-doc-titles
branch
from
August 2, 2026 20:17
6841507 to
b6c5c5b
Compare
longsizhuo
force-pushed
the
fix/zh-doc-titles
branch
from
August 2, 2026 20:28
b6c5c5b to
f9e2d80
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.
问题
一批中文文档的 frontmatter
title是早期机翻残留:正文是中文,标题却是乱码英文。挑几个最离谱的:213.Hiccup II213. 打家劫舍 IISword finger Offer II 021. Delete the countdown of the linked list n Node.md剑指 Offer II 021. 删除链表的倒数第 n 个结点2679.In the matrix and the harmony.md2679. 矩阵中的和76Minimum cover string.md76. 最小覆盖子串One question daily 2293. Great mini game2293. 极大极小游戏("打家劫舍"被译成了 Hiccup,"剑指" 被译成了 Sword finger。)
还有一批标题干脆把文件名连
.md后缀一起塞了进去,另有一篇的title: >-折叠标量跨了三行。title是页面<h1>和<title>、sitemap.xml、站内搜索索引、以及 #395 新加的/llms.txt索引的取值来源,所以这批坏标题同时在坑读者和坑搜索/AI 抓取。修法
正确标题不需要外部查询,仓库自己就有:
description已经写成LeetCode <编号>. <中文标题> 题解 — …(lib/seo-description.ts那轮补全的产物),直接从里面取description比文件名更可信:[121]买卖股票的最佳时期_translated.md文件名写的是"最佳时期",description 里是官方译名"最佳时机",取了后者。影响面
title,其余 frontmatter(docId/abbrlink/tags/date)一个字节没动.en.md英文版保持英文标题,未触碰prettier对正文零改动check-images和check-frontmatter-description通过另外 26 处被粗筛标记但故意没动:
RAG、PPO、CUDA、PyTorch、Transformer、Career、CMake这类本来就该是英文的标题。没做的事
这些文件的正文同样是机翻残留,例如:
而且部分
_translated.md与已存在的.en.md内容重复(如1004_translated.mdvs1004-max-consecutive-ones-iii.en.md),等于中文站在提供机翻英文正文。那是内容架构层面的事,需要人决定是重译、合并还是删除,本 PR 不碰。🤖 Generated with Claude Code