Commit 487dd6d
refactor(docs): community 技术文档重归类 + 301 兜底 + syncedFromPosts eyebrow (#351)
* refactor(docs): community 技术文档重归类 + 301 + syncedFromPosts eyebrow
按 IA 整理将 community 下技术内容分别归入目标分类:
git mv(30 个文件):
- community/dev-tips/* → learn/cs/dev-tips/(含 Katex/ 子目录和图片资产)
- community/language/* → career/language/(PTE 语言考试,目标人群同 career)
- community/papers/* → learn/ai/papers/(AI 论文读书笔记)
- community/tools/* → learn/ai/tools/(ML 实验追踪工具、AI 浏览器)
301 重定向(next.config.mjs):
- /docs/community/dev-tips → /zh/docs/learn/cs/dev-tips(含 :path* wildcard)
- /docs/community/language/:path* → /zh/docs/career/language/:path*
- /docs/community/papers/:path* → /zh/docs/learn/ai/papers/:path*
- /docs/community/tools → /zh/docs/learn/ai/tools(含 :path* wildcard)
- /docs/community → /zh/docs/learn(根路径废弃后兜底)
- 同步更正旧 CommunityShare/* wildcard destination 指向新路径
unsw-student-benefit 双存注记:
- frontmatter 加 syncedFromPosts/syncedAuthor/syncedPostsUrl(zh + en)
- docs 文章页模板在 h1 之前渲染「此文同步自作者主页 →」eyebrow
- PageData 类型同步补充三个字段
burnout-guide 和 community/mental-health/ 暂留,待 team-lead 确认作者归属。
* refactor(docs): 删叙事原文 + 加301跳转作者posts + 废弃community父目录
用户定删+301(不双存):
删除文件(8个):
- community/life/unsw-student-benefit.md + .en.md(搬入作者 posts)
- community/mental-health/burnout-guide.mdx + .en.mdx(搬入作者 posts)
- community/mental-health/index.mdx + .en.mdx(目录已空)
- community/index.mdx + .en.mdx(整个分类废弃)
撤销 syncedFromPosts frontmatter 注记(随文件删除,无需额外处理)。
新增301(next.config.mjs):
- /docs/community/life/unsw-student-benefit → /zh/u/github_163523387/posts/unsw-student-benefit
- /docs/community/mental-health/burnout-guide → /zh/u/github_114939201/posts/burnout-guide
- CommunityShare/Life/:path* wildcard 改指 /zh/docs/learn(兜底防404)
- CommunityShare/MentalHealth/:path* wildcard 改指 /zh/docs/learn(兜底防404)
/docs/community 根301已有(→ /zh/docs/learn),无需新增。
build验证:EXIT 0,community docs路由已从路由表消失,无回退。
* fix(redirect): CommunityShare 根兜底改指 /zh/docs/learn(pm CR)
/docs/CommunityShare → /zh/docs/community 会 404,community 已废弃。
改为 → /zh/docs/learn。
* fix(redirect+docs): 补 language/papers 精确 index 301 + 删 syncedFromPosts 死代码
Copilot CR(#351):
- next.config.mjs:language / papers 各补一条无 :path* 的精确 index 规则,
防止空路径命中 :path* wildcard 产生尾斜杠,避免 301→308 双跳。
- page.tsx:删 syncedFromPosts eyebrow 渲染块(删+301 路线已无 doc 携带该字段)。
- doc.ts:删 PageData 的 syncedFromPosts / syncedAuthor / syncedPostsUrl 字段(死代码)。
Co-authored-by: copilot-pull-request-reviewer[bot] <198982749+copilot-pull-request-reviewer[bot]@users.noreply.github.com>
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: copilot-pull-request-reviewer[bot] <198982749+copilot-pull-request-reviewer[bot]@users.noreply.github.com>1 parent 70c96c9 commit 487dd6d
40 files changed
Lines changed: 80 additions & 362 deletions
File tree
- content/docs
- career/language
- community
- life
- mental-health
- learn
- ai
- papers
- tools
- cs/dev-tips
- CommonUsedMarkdown.assets
- Katex
File renamed without changes.
File renamed without changes.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Lines changed: 0 additions & 81 deletions
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments