Skip to content

Commit df8df19

Browse files
refactor(docs): 语义化重组 — RAG 归 AI 基础模型,AI 项目归 AI 目录
背景:Scan 发现 3 处目录语义错配,这批修掉: - CommunityShare/RAG/{rag,embedding,context-engineering-intro} 实际上是 AI 核心基础设施(检索增强、向量嵌入、上下文工程), 放社区分享目录既不好发现也语义错位 → ai/foundation-models/rag/ - all-projects/ai-town 是 AI 多智能体模拟项目,不应和通用项目混 → ai/projects/ 本 PR 也作为 sync-uuid 跨路径贡献者追踪机制的大规模验证。 Workflow 只在 main / feat/contributor 触发,feature 分支零风险 (DB 不动),merge 后在 main 自动跑一次 backfill 核对。 变更点: 1. git mv 4 份原文 + 4 份翻译(.en.mdx / .en.md)= 8 个文件 - rag.mdx (+.en) → ai/foundation-models/rag/ - embedding.mdx (+.en) → ai/foundation-models/rag/ - context_engineering_intro.md (+.en) → 同上(顺便 rename 下划线 → kebab-case 统一命名规范) - ai-town.mdx (+.en) → ai/projects/ 2. 所有 docId 原样保留(验证 grep "^docId:" 通过,8 份一致) 3. placeholder 标签 tag-one / ai-project 替换成真实内容标签: - rag: rag-system / retrieval-augmented-generation / vector-search - embedding: embedding-models / vector-representation / rag-system - context-eng: context-engineering / prompt-engineering / llm-fundamentals - ai-town: ai-agent-simulation / multi-agent-systems / generative-agents / godot-engine 4. next.config.mjs 新增 async redirects(),所有老 URL 301 跳新 canonical,保护 SEO 权重 + 外链 + 用户收藏 验证预期(合 main 后 sync-uuid workflow 跑完): - 涉及 4 个 docId 的老贡献者 contributions 保持不变 - longsizhuo 本次 rename commit 在每个 docId 上 +1 - generated/doc-contributors.json path 字段更新为新位置 剩余工作(独立 PR): - 其余 78 份文档的 tag-one 占位符清理 - 文件名命名规范化批量(下划线 → kebab-case)
1 parent 02d3c87 commit df8df19

9 files changed

Lines changed: 59 additions & 6 deletions

File tree

app/docs/CommunityShare/RAG/context_engineering_intro.en.md renamed to app/docs/ai/foundation-models/rag/context-engineering-intro.en.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ title: A Quick Introduction to Context Engineering
33
description: ""
44
date: "2025-10-03"
55
tags:
6-
- tag-one
6+
- context-engineering
7+
- prompt-engineering
8+
- llm-fundamentals
79
docId: wdqqrepoy43jiieyyjmaekk1
810
lang: en
911
translatedFrom: zh

app/docs/CommunityShare/RAG/context_engineering_intro.md renamed to app/docs/ai/foundation-models/rag/context-engineering-intro.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ title: context engineering 快速了解
33
description: ""
44
date: "2025-10-03"
55
tags:
6-
- tag-one
6+
- context-engineering
7+
- prompt-engineering
8+
- llm-fundamentals
79
docId: wdqqrepoy43jiieyyjmaekk1
810
---
911

File renamed without changes.
File renamed without changes.

app/docs/CommunityShare/RAG/rag.en.mdx renamed to app/docs/ai/foundation-models/rag/rag.en.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ title: RAG
33
description: ""
44
date: "2025-09-19"
55
tags:
6-
- tag-one
6+
- rag-system
7+
- retrieval-augmented-generation
8+
- vector-search
79
docId: zywri1bs64awfi9utfjy14ll
810
lang: en
911
translatedFrom: zh
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ title: RAG
33
description: ""
44
date: "2025-09-19"
55
tags:
6-
- tag-one
6+
- rag-system
7+
- retrieval-augmented-generation
8+
- vector-search
79
docId: zywri1bs64awfi9utfjy14ll
810
---
911

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ title: AI Town Design Document
33
description: ""
44
date: "2025-10-18"
55
tags:
6-
- ai-project
6+
- ai-agent-simulation
7+
- multi-agent-systems
8+
- generative-agents
9+
- godot-engine
710
docId: bkxwg1m9p9rnm8062wsm020w
811
lang: en
912
translatedFrom: zh
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ title: AI小镇策划
33
description: ""
44
date: "2025-10-18"
55
tags:
6-
- ai-project
6+
- ai-agent-simulation
7+
- multi-agent-systems
8+
- generative-agents
9+
- godot-engine
710
docId: bkxwg1m9p9rnm8062wsm020w
811
---
912

next.config.mjs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,45 @@ const withNextIntl = createNextIntlPlugin("./i18n/request.ts");
2222
/** @type {import('next').NextConfig} */
2323
const config = {
2424
reactStrictMode: true,
25+
/**
26+
* 文档目录重组产生的老 URL → 新 canonical URL 的 301 重定向。
27+
*
28+
* 为什么需要:站点上线一段时间后,原路径被 Google 索引 + 被用户收藏 / 外链引用。
29+
* 目录重组(比如把 CommunityShare/RAG/* 搬到 ai/foundation-models/rag/*)
30+
* 必然改 URL;不加 301 的话老链接一律 404,SEO 权重流失 + 用户体验断裂。
31+
*
32+
* permanent=true 下发 308(Next.js 特性:permanent 对应 308,保留原 method;
33+
* 普通文件重定向 308 和 301 对爬虫基本等价),浏览器 / 爬虫会缓存跳转关系,
34+
* 后续直接打新 URL 省一次 round-trip。
35+
*
36+
* 每次再动 docs 路径,都要在这里补一条。
37+
*/
38+
async redirects() {
39+
return [
40+
// feat/docs-reorg-rag-projects(2026-04-18)
41+
{
42+
source: "/docs/CommunityShare/RAG/rag",
43+
destination: "/docs/ai/foundation-models/rag/rag",
44+
permanent: true,
45+
},
46+
{
47+
source: "/docs/CommunityShare/RAG/embedding",
48+
destination: "/docs/ai/foundation-models/rag/embedding",
49+
permanent: true,
50+
},
51+
{
52+
// 文件名也规范化成 kebab-case:context_engineering_intro → context-engineering-intro
53+
source: "/docs/CommunityShare/RAG/context_engineering_intro",
54+
destination: "/docs/ai/foundation-models/rag/context-engineering-intro",
55+
permanent: true,
56+
},
57+
{
58+
source: "/docs/all-projects/ai-town",
59+
destination: "/docs/ai/projects/ai-town",
60+
permanent: true,
61+
},
62+
];
63+
},
2564
async rewrites() {
2665
const backendUrl = process.env.BACKEND_URL ?? "http://localhost:8080";
2766
return [

0 commit comments

Comments
 (0)