Skip to content

Commit 802a2dc

Browse files
alienzjqwencoder
andcommitted
docs: 添加 MkDocs 2.0 兼容性说明
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
1 parent 73611be commit 802a2dc

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

docs/MKDOCS_2_0_NOTE.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# MkDocs 2.0 兼容性说明
2+
3+
## ⚠️ 重要提示
4+
5+
MkDocs 2.0 将引入重大变更,目前**不适用于生产环境**
6+
7+
## 当前配置
8+
9+
SkillPI 已配置使用稳定的 MkDocs 版本:
10+
11+
```toml
12+
# pyproject.toml
13+
mkdocs>=1.5.0,<2.0.0
14+
mkdocs-material>=9.5.0,<10.0.0
15+
```
16+
17+
## 已修复的问题
18+
19+
### 1. 主题图标路径
20+
21+
**问题**: Material for MkDocs 新版本更改了图标路径
22+
23+
**修复**:
24+
```yaml
25+
# mkdocs.yml
26+
palette:
27+
- media: "(prefers-color-scheme)"
28+
toggle:
29+
icon: material/brightness-auto # 使用新版图标
30+
```
31+
32+
### 2. 插件系统
33+
34+
Material 团队警告 MkDocs 2.0 将移除插件系统。当前配置已禁用不必要的插件。
35+
36+
## 部署配置
37+
38+
GitHub Actions 已配置安装兼容版本:
39+
40+
```yaml
41+
# .github/workflows/deploy.yml
42+
- name: Install dependencies
43+
run: |
44+
pip install -e ".[pipeline]"
45+
pip install mkdocs-material~=9.5.0 # 固定 9.5.x 版本
46+
```
47+
48+
## 本地测试
49+
50+
```bash
51+
# 安装依赖
52+
pip install -e ".[pipeline]"
53+
54+
# 构建测试
55+
mkdocs build --clean
56+
57+
# 本地预览
58+
mkdocs serve
59+
```
60+
61+
## 参考链接
62+
63+
- [Material for MkDocs 官方博客](https://squidfunk.github.io/mkdocs-material/blog/2026/02/18/mkdocs-2.0/)
64+
- [MkDocs 官方文档](https://www.mkdocs.org/)
65+
66+
## 更新计划
67+
68+
我们将:
69+
1. 监控 MkDocs 2.0 进展
70+
2. 等待稳定的迁移方案
71+
3. 在确保兼容性后更新
72+
73+
**当前建议**: 使用配置的稳定版本,不要升级到 MkDocs 2.0

0 commit comments

Comments
 (0)