Skip to content

Commit 0fc17ad

Browse files
authored
Merge pull request #9 from Crokily/feat/refactor-docs
Feat: Migrate to Fumadocs and Update Contribution Guidelines (Issue #8)
2 parents f443085 + 0ae0e60 commit 0fc17ad

21 files changed

+1908
-2021
lines changed

.github/workflows/content-check.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ on:
55
paths:
66
- '**/*.md'
77
- '**/*.mdx'
8-
- 'contentlayer.config.ts'
8+
- 'source.config.ts'
9+
- 'app/docs/**'
10+
- 'lib/source.ts'
11+
- 'mdx-components.tsx'
912
- 'package.json'
1013
- 'pnpm-lock.yaml'
1114
- 'next.config.mjs'
@@ -32,5 +35,5 @@ jobs:
3235
cache: 'pnpm'
3336

3437
- run: pnpm install --frozen-lockfile
35-
- run: pnpm run check:content
36-
38+
# Build the site to validate MDX and docs using Fumadocs
39+
- run: pnpm build

.source/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// @ts-nocheck -- skip type checking
2+
import * as docs_7 from "../app/docs/computer-science/data-structures/linked-list/index.mdx?collection=docs&hash=1757698272687"
3+
import * as docs_6 from "../app/docs/computer-science/data-structures/linked-list/01-singly-linked-list.mdx?collection=docs&hash=1757698272687"
4+
import * as docs_5 from "../app/docs/computer-science/data-structures/array/index.mdx?collection=docs&hash=1757698272687"
5+
import * as docs_4 from "../app/docs/computer-science/data-structures/array/02-dynamic-array.mdx?collection=docs&hash=1757698272687"
6+
import * as docs_3 from "../app/docs/computer-science/data-structures/array/01-static-array.mdx?collection=docs&hash=1757698272687"
7+
import * as docs_2 from "../app/docs/computer-science/data-structures/index.mdx?collection=docs&hash=1757698272687"
8+
import * as docs_1 from "../app/docs/guide/HelloWorld.md?collection=docs&hash=1757698272687"
9+
import * as docs_0 from "../app/docs/computer-science/index.mdx?collection=docs&hash=1757698272687"
10+
import { _runtime } from "fumadocs-mdx"
11+
import * as _source from "../source.config"
12+
export const docs = _runtime.docs<typeof _source.docs>([{ info: {"path":"computer-science\\index.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/index.mdx"}, data: docs_0 }, { info: {"path":"guide\\HelloWorld.md","absolutePath":"D:/work/involutionhell.github.io/app/docs/guide/HelloWorld.md"}, data: docs_1 }, { info: {"path":"computer-science\\data-structures\\index.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/data-structures/index.mdx"}, data: docs_2 }, { info: {"path":"computer-science\\data-structures\\array\\01-static-array.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/data-structures/array/01-static-array.mdx"}, data: docs_3 }, { info: {"path":"computer-science\\data-structures\\array\\02-dynamic-array.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/data-structures/array/02-dynamic-array.mdx"}, data: docs_4 }, { info: {"path":"computer-science\\data-structures\\array\\index.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/data-structures/array/index.mdx"}, data: docs_5 }, { info: {"path":"computer-science\\data-structures\\linked-list\\01-singly-linked-list.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/data-structures/linked-list/01-singly-linked-list.mdx"}, data: docs_6 }, { info: {"path":"computer-science\\data-structures\\linked-list\\index.mdx","absolutePath":"D:/work/involutionhell.github.io/app/docs/computer-science/data-structures/linked-list/index.mdx"}, data: docs_7 }], [])

.source/source.config.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// source.config.ts
2+
import { defineDocs, defineConfig } from "fumadocs-mdx/config";
3+
var docs = defineDocs({
4+
dir: "app/docs"
5+
});
6+
var source_config_default = defineConfig();
7+
export {
8+
source_config_default as default,
9+
docs
10+
};

CONTRIBUTING.md

Lines changed: 117 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ function example() {
173173

174174
### 步骤4:测试修改
175175

176-
使用 Contentlayer 验证内容:
176+
使用 Fumadocs 验证内容:
177177

178178
```bash
179-
pnpm check:content
179+
pnpm build
180180
```
181181

182182
此命令将:
@@ -292,6 +292,33 @@ pnpm export
292292

293293
---
294294

295+
## 📋 开发流程
296+
297+
### 🔄 功能开发前请先提 Issue
298+
299+
**重要提醒**:在开始任何功能开发之前,请先在 [GitHub Issues](../../issues) 中创建或查找相关 issue。这有助于:
300+
301+
- **避免重复开发**:确保不会与他人正在进行的开发冲突
302+
- **统一开发方向**:通过讨论确定功能的具体需求和实现方案
303+
- **透明开发进度**:让社区了解项目当前开发状态
304+
- **便于协作**:其他贡献者可以参与讨论和提供建议
305+
306+
#### 创建 Issue 的最佳实践
307+
308+
1. **检查现有 Issue**:先搜索是否已有相关 issue,避免重复创建
309+
2. **清晰描述**:详细说明功能需求、预期效果和使用场景
310+
3. **添加标签**:使用合适的标签(如 `enhancement`, `feature`, `discussion`
311+
4. **关联开发分支**:如果开始开发,请在 issue 中链接你的开发分支
312+
313+
#### Issue 类型建议
314+
315+
- **功能请求** (`feature`): 新功能需求
316+
- **改进建议** (`enhancement`): 现有功能的改进
317+
- **问题反馈** (`bug`): 发现的bug或问题
318+
- **讨论话题** (`discussion`): 需要社区讨论的话题
319+
320+
---
321+
295322
## 🤝 如何贡献
296323

297324
### 基本工作流程
@@ -324,6 +351,32 @@ pnpm export
324351
- 改进移动端响应性
325352
- 为 UI 添加新功能
326353

354+
#### 💡 UI 开发建议
355+
356+
**优先使用 Fumadocs UI 组件库**
357+
358+
本项目已迁移到 **Fumadocs UI** 作为主要 UI 框架。请在进行 UI 相关开发时优先考虑:
359+
360+
1. **使用 Fumadocs UI 组件**
361+
- 查看 [Fumadocs UI 文档](https://fumadocs.dev/docs/ui) 了解可用组件
362+
- 优先使用内置组件而不是自定义实现
363+
- 遵循 Fumadocs UI 的设计规范和样式指南
364+
365+
2. **保持设计一致性**
366+
- 使用统一的颜色方案和字体
367+
- 遵循现有的组件样式和交互模式
368+
- 保持响应式设计的兼容性
369+
370+
3. **新功能开发**
371+
- 在提 issue 讨论新功能需求时,请明确 UI 方面的具体要求
372+
- 优先考虑使用 Fumadocs UI 的扩展功能
373+
- 如需自定义组件,请与团队讨论以保持一致性
374+
375+
4. **测试要求**
376+
- 确保新 UI 功能在不同设备和屏幕尺寸下正常工作
377+
- 测试主题切换(浅色/深色模式)兼容性
378+
- 验证无障碍访问功能
379+
327380
**🛠️ 技术改进**
328381
- 改进构建过程
329382
- 添加新的脚本或工具
@@ -366,11 +419,11 @@ Students need better resources for understanding dynamic programming concepts.
366419

367420
## How
368421
- Created new MDX file with comprehensive examples
369-
- Tested content generation with `pnpm check:content`
422+
- Tested content generation with `pnpm build`
370423
- Verified rendering on local development server
371424

372425
## Testing
373-
- Contentlayer validation passed
426+
- Fumadocs validation passed
374427
- No linting errors
375428
- Previewed locally at `/computer-science/algorithms/dynamic-programming`
376429
```
@@ -381,7 +434,7 @@ Students need better resources for understanding dynamic programming concepts.
381434

382435
1. **自动检查**
383436
- GitHub Actions 将运行自动化测试
384-
- Contentlayer 将验证你的内容
437+
- Fumadocs 将验证你的内容
385438
- Linting 将检查代码质量
386439

387440
2. **同行评审**
@@ -427,7 +480,7 @@ Students need better resources for understanding dynamic programming concepts.
427480
# Contributing Guide
428481

429482
Thank you for your interest in **Involution Hell Docs**!
430-
This is an open-source documentation site built with **Next.js + Contentlayer**, with content stored in the `docs/` folder.
483+
This is an open-source documentation site built with **Next.js + Fumadocs**, with content stored in the `app/docs/` folder.
431484
We welcome Pull Requests and Issues!
432485

433486
---
@@ -605,10 +658,10 @@ Summary of your article...
605658

606659
### Step 4: Test Your Changes
607660

608-
Validate your content with Contentlayer:
661+
Validate your content with Fumadocs:
609662

610663
```bash
611-
pnpm check:content
664+
pnpm build
612665
```
613666

614667
This command will:
@@ -724,6 +777,33 @@ No manual operation required!
724777

725778
---
726779

780+
## 📋 Development Workflow
781+
782+
### 🔄 Create an Issue Before Starting Development
783+
784+
**Important Reminder**: Before starting any feature development, please first create or find a related issue in [GitHub Issues](../../issues). This helps to:
785+
786+
- **Avoid Duplicate Work**: Ensure no conflicts with others' ongoing development
787+
- **Align Development Direction**: Determine specific requirements and implementation plans through discussion
788+
- **Transparent Progress**: Keep the community informed about project development status
789+
- **Facilitate Collaboration**: Allow other contributors to participate in discussions and provide suggestions
790+
791+
#### Best Practices for Creating Issues
792+
793+
1. **Check Existing Issues**: First search for related issues to avoid duplication
794+
2. **Clear Description**: Detail the feature requirements, expected outcomes, and use cases
795+
3. **Add Labels**: Use appropriate labels (e.g., `enhancement`, `feature`, `discussion`)
796+
4. **Link Development Branch**: If development begins, link your development branch in the issue
797+
798+
#### Recommended Issue Types
799+
800+
- **Feature Request** (`feature`): New feature requirements
801+
- **Enhancement** (`enhancement`): Improvements to existing features
802+
- **Bug Report** (`bug`): Bugs or issues found
803+
- **Discussion** (`discussion`): Topics requiring community discussion
804+
805+
---
806+
727807
## 🤝 How to Contribute
728808

729809
### Basic Workflow
@@ -756,6 +836,32 @@ We welcome the following types of contributions:
756836
- Improve mobile responsiveness
757837
- Add new features to the UI
758838

839+
#### 💡 UI Development Recommendations
840+
841+
**Prioritize Fumadocs UI Component Library**:
842+
843+
This project has migrated to **Fumadocs UI** as the primary UI framework. Please prioritize the following when developing UI-related features:
844+
845+
1. **Use Fumadocs UI Components**:
846+
- Check [Fumadocs UI documentation](https://fumadocs.dev/docs/ui) for available components
847+
- Prefer built-in components over custom implementations
848+
- Follow Fumadocs UI design standards and style guidelines
849+
850+
2. **Maintain Design Consistency**:
851+
- Use unified color schemes and fonts
852+
- Follow existing component styles and interaction patterns
853+
- Maintain responsive design compatibility
854+
855+
3. **New Feature Development**:
856+
- When creating issues for new features, clearly specify UI requirements
857+
- Prioritize Fumadocs UI's extension features
858+
- Discuss custom components with the team to maintain consistency
859+
860+
4. **Testing Requirements**:
861+
- Ensure new UI features work across different devices and screen sizes
862+
- Test theme switching (light/dark mode) compatibility
863+
- Verify accessibility features
864+
759865
**🛠️ Technical Improvements**
760866
- Improve build process
761867
- Add new scripts or tools
@@ -798,11 +904,11 @@ Students need better resources for understanding dynamic programming concepts.
798904

799905
## How
800906
- Created new MDX file with comprehensive examples
801-
- Tested content generation with `pnpm check:content`
907+
- Tested content generation with `pnpm build`
802908
- Verified rendering on local development server
803909

804910
## Testing
805-
- Contentlayer validation passed
911+
- Fumadocs validation passed
806912
- No linting errors
807913
- Previewed locally at `/computer-science/algorithms/dynamic-programming`
808914
```
@@ -813,7 +919,7 @@ Students need better resources for understanding dynamic programming concepts.
813919

814920
1. **Automated Checks**
815921
- GitHub Actions will run automated tests
816-
- Contentlayer validation will check your content
922+
- Fumadocs validation will check your content
817923
- Linting will check code quality
818924

819925
2. **Peer Review**

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## ✨ 特性
88

9-
- 🚀 **现代化技术栈**:Next.js 15 + Contentlayer + MDX
9+
- 🚀 **现代化技术栈**:Next.js 15 + Fumadocs + MDX
1010
- 🎨 **美观界面**:基于 Tailwind CSS 和 shadcn/ui 构建
1111
- 🌍 **双语支持**:中英文内容
1212
- 📱 **响应式设计**:完美适配所有设备
@@ -46,7 +46,7 @@ pnpm dev
4646
│ │ └── 📂 computer-science/ # 计算机科学知识库
4747
│ ├── 📄 layout.tsx # 根布局
4848
│ └── 📄 page.tsx # 主页
49-
├── 📂 contentlayer.config.ts # Contentlayer 配置
49+
├── 📂 source.config.ts # Fumadocs 配置
5050
├── 📂 tailwind.config.ts # Tailwind CSS 配置
5151
└── 📄 package.json # 依赖和脚本
5252
```
@@ -99,7 +99,7 @@ pnpm build # 构建生产版本
9999
pnpm start # 启动生产服务器
100100

101101
# 内容
102-
pnpm check:content # 使用 Contentlayer 验证内容
102+
103103

104104
# 导出
105105
pnpm export # 导出静态站点到 /out 目录
@@ -112,7 +112,7 @@ pnpm export # 导出静态站点到 /out 目录
112112
## 🙏 致谢
113113

114114
- 使用 [Next.js](https://nextjs.org/) 构建
115-
-[Contentlayer](https://contentlayer.dev/) 驱动
115+
-[Fumadocs](https://fumadocs.vercel.app/) 驱动
116116
- 使用 [Tailwind CSS](https://tailwindcss.com/) 样式
117117
- UI 组件来自 [shadcn/ui](https://ui.shadcn.com/)
118118

@@ -141,7 +141,7 @@ This is a collaborative documentation platform built with modern web technologie
141141

142142
## ✨ Features
143143

144-
- 🚀 **Modern Tech Stack**: Next.js 15 + Contentlayer + MDX
144+
- 🚀 **Modern Tech Stack**: Next.js 15 + Fumadocs + MDX
145145
- 🎨 **Beautiful UI**: Built with Tailwind CSS and shadcn/ui
146146
- 🌍 **Bilingual Support**: Chinese & English content
147147
- 📱 **Responsive Design**: Works perfectly on all devices
@@ -181,7 +181,7 @@ Open [http://localhost:3000](http://localhost:3000) to see the site.
181181
│ │ └── 📂 computer-science/ # CS Knowledge Base
182182
│ ├── 📄 layout.tsx # Root Layout
183183
│ └── 📄 page.tsx # Homepage
184-
├── 📂 contentlayer.config.ts # Contentlayer Configuration
184+
├── 📂 source.config.ts # Fumadocs Configuration
185185
├── 📂 tailwind.config.ts # Tailwind CSS Config
186186
└── 📄 package.json # Dependencies & Scripts
187187
```
@@ -234,7 +234,7 @@ pnpm build # Build for production
234234
pnpm start # Start production server
235235

236236
# Content
237-
pnpm check:content # Validate content with Contentlayer
237+
238238

239239
# Export
240240
pnpm export # Export static site to /out
@@ -247,7 +247,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
247247
## 🙏 Acknowledgments
248248

249249
- Built with [Next.js](https://nextjs.org/)
250-
- Powered by [Contentlayer](https://contentlayer.dev/)
250+
- Powered by [Fumadocs](https://fumadocs.vercel.app/)
251251
- Styled with [Tailwind CSS](https://tailwindcss.com/)
252252
- UI components from [shadcn/ui](https://ui.shadcn.com/)
253253

@@ -258,4 +258,3 @@ Special thanks to all our contributors! 🎉
258258
- 📧 Issues: [GitHub Issues](https://github.com/involutionhell/involutionhell.github.io/issues)
259259
- 💬 Discussions: [GitHub Discussions](https://github.com/involutionhell/involutionhell.github.io/discussions)
260260
- 🌟 Stars: Show your support with a ⭐
261-

app/components/MDXContent.tsx

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)