Skip to content

Commit 596292b

Browse files
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 确认作者归属。
1 parent 70c96c9 commit 596292b

36 files changed

Lines changed: 76 additions & 11 deletions

app/[locale]/docs/[...slug]/page.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,17 @@ export default async function DocPage({ params }: Param) {
126126
/>
127127
<DocsPage toc={page.data.toc}>
128128
<DocsBody>
129+
{data.syncedFromPosts && data.syncedPostsUrl && (
130+
<p className="font-mono text-[10px] uppercase tracking-widest text-neutral-500 mb-4">
131+
此文同步自作者主页 →{" "}
132+
<a
133+
href={data.syncedPostsUrl}
134+
className="underline hover:text-neutral-700 dark:hover:text-neutral-300 transition-colors"
135+
>
136+
{data.syncedAuthor ? `${data.syncedAuthor} 的文章` : "原文"}
137+
</a>
138+
</p>
139+
)}
129140
<div className="mb-6 flex flex-col gap-3 border-b border-border pb-6 md:mb-8 md:flex-row md:items-start md:justify-between">
130141
<h1 className="text-3xl font-extrabold tracking-tight md:text-4xl">
131142
{page.data.title}

app/types/doc.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ export interface PageData {
3939
lang?: string;
4040
[key: string]: unknown;
4141
};
42+
// docs 文章同步自作者 posts 主页时在 frontmatter 设置,
43+
// 渲染层据此在文章顶部加「此文同步自作者主页 →」导航提示。
44+
syncedFromPosts?: boolean;
45+
syncedAuthor?: string;
46+
syncedPostsUrl?: string;
4247
// 故意不挂顶层 [key: string]: unknown 索引签名 —— Fumadocs 的 page.data 由
4348
// zod DocOut 推出,没有 index signature;如果在 PageData 上挂一个,as PageData
4449
// 会触发 TS2352 "neither type sufficiently overlaps"。所有需要的字段都已
File renamed without changes.
File renamed without changes.

content/docs/community/life/unsw-student-benefit.en.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ lang: en
1212
translatedFrom: zh
1313
translatedAt: 2026-05-11T00:00:00Z
1414
translatorAgent: claude-sonnet-4-6
15+
syncedFromPosts: true
16+
syncedAuthor: "Mira"
17+
syncedPostsUrl: "/u/mira/posts/unsw-student-benefit"
1518
---
1619

1720
Recently chatting with classmates, I discovered that our university offers a wealth of hidden benefits that many students are completely unaware of — not just career-related, but also academic. So today I'm here to close the information gap and compile a collection of these hidden campus perks. Feel free to add more in the comments!

content/docs/community/life/unsw-student-benefit.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ tags:
88
- student-resources
99
- australia-study
1010
docId: jgyg6bp0nceyrxirz5qw3zsv
11+
syncedFromPosts: true
12+
syncedAuthor: "Mira"
13+
syncedPostsUrl: "/u/mira/posts/unsw-student-benefit"
1114
---
1215

1316
最近和同学聊天,发现学校有好多隐藏福利很多同学都不知道,不光是就业方面还有学业方面的各种福利。那么今天学姐就来打破信息差,为大家整理一个校园隐藏福利福利合集,还有其他更多隐藏福利欢迎大家评论区补充哦。
File renamed without changes.
File renamed without changes.

content/docs/community/papers/prompt-repetition-improves-non-reasoning-llms.en.md renamed to content/docs/learn/ai/papers/prompt-repetition-improves-non-reasoning-llms.en.md

File renamed without changes.

content/docs/community/papers/prompt-repetition-improves-non-reasoning-llms.md renamed to content/docs/learn/ai/papers/prompt-repetition-improves-non-reasoning-llms.md

File renamed without changes.

0 commit comments

Comments
 (0)