refactor(docs): community 技术文档重归类 + 301 兜底 + syncedFromPosts eyebrow#351
Merged
Conversation
按 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 确认作者归属。
|
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 reorganizes technical docs previously under community/ into more semantically accurate top-level IA sections (learn/, career/), adds 301 redirects to prevent link rot, and introduces a “synced from posts” eyebrow on doc pages driven by frontmatter.
Changes:
- Updated
next.config.mjsredirects forcommunity/*→ new IA destinations (and adjusted existingCommunityShare/*redirects). - Added
syncedFromPosts/syncedAuthor/syncedPostsUrltyping + doc-page rendering logic, and annotated the UNSW student benefit doc frontmatter. - Added/relocated multiple docs into the new
learn/cs/dev-tips,learn/ai/tools,learn/ai/papers, andcareer/languagesections (zh/en).
Reviewed changes
Copilot reviewed 5 out of 36 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| next.config.mjs | Adds/updates 301 redirect rules for community IA reclassification and related legacy paths. |
| app/types/doc.ts | Extends PageData typing to include synced-from-posts metadata fields. |
| app/[locale]/docs/[...slug]/page.tsx | Renders a “synced from posts” eyebrow on doc pages when frontmatter flags are present. |
| content/docs/community/life/unsw-student-benefit.md | Adds synced-from-posts frontmatter annotations. |
| content/docs/community/life/unsw-student-benefit.en.md | Adds synced-from-posts frontmatter annotations (en). |
| content/docs/learn/cs/dev-tips/index.mdx | Adds new dev-tips section index page (zh). |
| content/docs/learn/cs/dev-tips/index.en.mdx | Adds new dev-tips section index page (en). |
| content/docs/learn/cs/dev-tips/raspberry-guide.md | Adds Raspberry Pi Minecraft server guide (zh). |
| content/docs/learn/cs/dev-tips/raspberry-guide.en.md | Adds Raspberry Pi Minecraft server guide (en). |
| content/docs/learn/cs/dev-tips/picturecdn.mdx | Adds PictureCDN GitHub image hosting guide (zh). |
| content/docs/learn/cs/dev-tips/picturecdn.en.mdx | Adds PictureCDN GitHub image hosting guide (en). |
| content/docs/learn/cs/dev-tips/git101.mdx | Adds Git basics cheat sheet (zh). |
| content/docs/learn/cs/dev-tips/git101.en.mdx | Adds Git basics cheat sheet (en). |
| content/docs/learn/cs/dev-tips/CommonUsedMarkdown.md | Adds common Markdown syntax reference (zh). |
| content/docs/learn/cs/dev-tips/CommonUsedMarkdown.en.md | Adds common Markdown syntax reference (en). |
| content/docs/learn/cs/dev-tips/cloudflare-r2-sharex-free-image-hosting.mdx | Adds Cloudflare R2 + ShareX image hosting guide (zh). |
| content/docs/learn/cs/dev-tips/cloudflare-r2-sharex-free-image-hosting.en.mdx | Adds Cloudflare R2 + ShareX image hosting guide (en). |
| content/docs/learn/cs/dev-tips/Katex/index.mdx | Adds KaTeX syntax index page (zh). |
| content/docs/learn/cs/dev-tips/Katex/index.en.mdx | Adds KaTeX syntax index page (en). |
| content/docs/learn/cs/dev-tips/Katex/Seb1.mdx | Adds KaTeX symbol reference (zh). |
| content/docs/learn/cs/dev-tips/Katex/Seb1.en.mdx | Adds KaTeX symbol reference (en). |
| content/docs/learn/cs/dev-tips/Katex/Seb2.mdx | Adds KaTeX formula syntax examples (zh). |
| content/docs/learn/cs/dev-tips/Katex/Seb2.en.mdx | Adds KaTeX formula syntax examples (en). |
| content/docs/learn/ai/tools/index.md | Adds AI tools series index (zh). |
| content/docs/learn/ai/tools/index.en.md | Adds AI tools series index (en). |
| content/docs/learn/ai/tools/swanlab.mdx | Adds SwanLab quick start (zh). |
| content/docs/learn/ai/tools/swanlab.en.mdx | Adds SwanLab quick start (en). |
| content/docs/learn/ai/tools/perplexity-comet.md | Adds Perplexity Comet article (zh). |
| content/docs/learn/ai/tools/perplexity-comet.en.md | Adds Perplexity Comet article (en). |
| content/docs/learn/ai/papers/prompt-repetition-improves-non-reasoning-llms.md | Adds paper note page under new IA (zh). |
| content/docs/learn/ai/papers/prompt-repetition-improves-non-reasoning-llms.en.md | Adds paper note page under new IA (en). |
| content/docs/learn/ai/papers/leworldmodel.md | Adds LeWorldModel paper note page under new IA (zh). |
| content/docs/learn/ai/papers/leworldmodel.en.md | Adds LeWorldModel paper note page under new IA (en). |
| content/docs/career/language/pte-intro.md | Adds PTE intro under new IA (zh). |
| content/docs/career/language/pte-intro.en.md | Adds PTE intro under new IA (en). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+230
to
+234
| // language(语言考试)→ career/language | ||
| { | ||
| source: "/docs/community/language/:path*", | ||
| destination: "/zh/docs/career/language/:path*", | ||
| statusCode: 301, |
Comment on lines
+129
to
+136
| {data.syncedFromPosts && data.syncedPostsUrl && ( | ||
| <p className="font-mono text-[10px] uppercase tracking-widest text-neutral-500 mb-4"> | ||
| 此文同步自作者主页 →{" "} | ||
| <a | ||
| href={data.syncedPostsUrl} | ||
| className="underline hover:text-neutral-700 dark:hover:text-neutral-300 transition-colors" | ||
| > | ||
| {data.syncedAuthor ? `${data.syncedAuthor} 的文章` : "原文"} |
Comment on lines
+132
to
+137
| <a | ||
| href={data.syncedPostsUrl} | ||
| className="underline hover:text-neutral-700 dark:hover:text-neutral-300 transition-colors" | ||
| > | ||
| {data.syncedAuthor ? `${data.syncedAuthor} 的文章` : "原文"} | ||
| </a> |
用户定删+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路由已从路由表消失,无回退。
/docs/CommunityShare → /zh/docs/community 会 404,community 已废弃。 改为 → /zh/docs/learn。
…s 死代码 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>
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.
Summary
按 IA 整理将 community 下技术内容分别迁移到语义更准确的顶层分类,同时补全 301 防止外链断链:
syncedFromPosts: true时在 h1 前显示「此文同步自作者主页 →」导航提示(mono 10px,中性色)未动:community/mental-health(burnout-guide 等作者归属确认),community/index,community/life/unsw-student-benefit 文件本身(仅加 frontmatter 注记,实际 posts 迁移等 backend-dev 跑脚本)。
Test plan
先别 merge,等 team-lead 和 pm 过一遍。