Skip to content

Commit 8601163

Browse files
committed
feat: improve and refactor the site
Signed-off-by: bitliu <[email protected]>
1 parent 65c48fc commit 8601163

File tree

77 files changed

+3395
-91
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+3395
-91
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,5 @@ example_prd.txt
9797
scripts/prd.txt
9898
.env.taskmaster
9999
package-lock.json
100-
package.json
100+
101+
website/build

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,24 @@ download-models:
155155
@if [ ! -d "models/pii_classifier_modernbert_base_presidio_token_model" ]; then \
156156
hf download LLM-Semantic-Router/pii_classifier_modernbert-base_presidio_token_model --local-dir models/pii_classifier_modernbert-base_presidio_token_model; \
157157
fi
158+
159+
# Documentation targets
160+
docs-install:
161+
@echo "Installing documentation dependencies..."
162+
cd website && npm install
163+
164+
docs-dev: docs-install
165+
@echo "Starting documentation development server..."
166+
cd website && npm start
167+
168+
docs-build: docs-install
169+
@echo "Building documentation for production..."
170+
cd website && npm run build
171+
172+
docs-serve: docs-build
173+
@echo "Serving production documentation..."
174+
cd website && npm run serve
175+
176+
docs-clean:
177+
@echo "Cleaning documentation build artifacts..."
178+
cd website && npm run clear

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# LLM Semantic Router
2-
31
<div align="center">
42

5-
<img src="docs/logo.png" alt="LLM Semantic Router" width="200"/>
3+
<img src="website/static/img/repo.png" alt="LLM Semantic Router"/>
64

75
[![Documentation](https://img.shields.io/badge/docs-read%20the%20docs-blue)](https://llm-semantic-router.readthedocs.io/en/latest/)
86
[![Hugging Face](https://img.shields.io/badge/🤗%20Hugging%20Face-Community-yellow)](https://huggingface.co/LLM-Semantic-Router)
@@ -11,7 +9,7 @@
119

1210
**📚 [Complete Documentation](https://llm-semantic-router.readthedocs.io/en/latest/) | 🚀 [Quick Start](https://llm-semantic-router.readthedocs.io/en/latest/getting-started/quick-start/) | 🏗️ [Architecture](https://llm-semantic-router.readthedocs.io/en/latest/architecture/system-architecture/) | 📖 [API Reference](https://llm-semantic-router.readthedocs.io/en/latest/api/router/)**
1311

14-
![](./docs/code.png)
12+
![](./website/static/img/code.png)
1513

1614
</div>
1715

@@ -55,11 +53,11 @@ This is achieved using BERT classification. Conceptually similar to Mixture-of-E
5553

5654
As such, the overall inference accuracy is improved by using a pool of models that are better suited for different types of tasks:
5755

58-
![Model Accuracy](./docs/category_accuracies.png)
56+
![Model Accuracy](./website/static/img/category_accuracies.png)
5957

6058
The screenshot below shows the LLM Router dashboard in Grafana.
6159

62-
![LLM Router Dashboard](./docs/grafana_screenshot.png)
60+
![LLM Router Dashboard](./website/static/img/grafana_screenshot.png)
6361

6462
The router is implemented in two ways: Golang (with Rust FFI based on Candle) and Python. Benchmarking will be conducted to determine the best implementation.
6563

mkdocs.yml

Lines changed: 0 additions & 77 deletions
This file was deleted.
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# 技术方案设计
2+
3+
## 技术架构
4+
5+
### 核心技术栈
6+
- **Docusaurus 3.x**: 现代化的静态网站生成器
7+
- **React 18**: 用于自定义组件和页面
8+
- **TypeScript**: 提供类型安全
9+
- **MDX**: 支持在 Markdown 中使用 React 组件
10+
- **Mermaid**: 图表渲染支持
11+
- **Algolia DocSearch**: 搜索功能(可选)
12+
13+
### 项目结构
14+
```
15+
website/
16+
├── docusaurus.config.js # Docusaurus 配置
17+
├── sidebars.js # 侧边栏配置
18+
├── package.json # 依赖管理
19+
├── src/
20+
│ ├── components/ # 自定义 React 组件
21+
│ ├── css/ # 自定义样式
22+
│ ├── pages/ # 自定义页面
23+
│ └── theme/ # 主题自定义
24+
├── docs/ # 文档内容(迁移自现有 docs/)
25+
├── static/ # 静态资源
26+
└── build/ # 构建输出
27+
```
28+
29+
### 科技感设计方案
30+
31+
#### 配色方案
32+
- **主色调**: 深蓝色系 (#0D1117, #161B22, #21262D)
33+
- **强调色**: 霓虹蓝 (#58A6FF), 霓虹绿 (#7C3AED)
34+
- **文本色**: 高对比度白色和灰色
35+
- **代码块**: 暗色主题配合语法高亮
36+
37+
#### 视觉效果
38+
- **渐变背景**: 深色渐变背景
39+
- **毛玻璃效果**: 导航栏和卡片组件
40+
- **动画效果**: 页面切换和悬停动画
41+
- **图标系统**: 现代化的 Feather Icons 或 Heroicons
42+
43+
#### 自定义组件
44+
- **Hero Section**: 带动画的首页展示区域
45+
- **Feature Cards**: 功能特性展示卡片
46+
- **Code Playground**: 交互式代码示例
47+
- **Architecture Diagram**: 增强的架构图展示
48+
49+
### 迁移策略
50+
51+
#### 内容迁移
52+
1. **文档结构映射**:
53+
- `docs/index.md``docs/intro.md`
54+
- 保持现有的文件夹结构
55+
- 更新内部链接格式
56+
57+
2. **导航配置**:
58+
-`mkdocs.yml` 的 nav 配置转换为 `sidebars.js`
59+
- 保持相同的层级结构
60+
61+
3. **资源迁移**:
62+
- 图片文件移动到 `static/img/`
63+
- 更新图片引用路径
64+
65+
#### 功能增强
66+
1. **Mermaid 集成**: 使用 `@docusaurus/theme-mermaid` 插件
67+
2. **代码高亮**: 配置 Prism 主题和语言支持
68+
3. **搜索功能**: 集成本地搜索或 Algolia DocSearch
69+
4. **PWA 支持**: 离线访问和安装功能
70+
71+
### 构建和部署
72+
73+
#### 开发环境
74+
- `npm start`: 启动开发服务器
75+
- `npm run build`: 构建生产版本
76+
- `npm run serve`: 预览生产版本
77+
78+
#### Makefile 集成
79+
```makefile
80+
# 文档相关命令
81+
docs-install:
82+
cd website && npm install
83+
84+
docs-dev: docs-install
85+
cd website && npm start
86+
87+
docs-build: docs-install
88+
cd website && npm run build
89+
90+
docs-serve: docs-build
91+
cd website && npm run serve
92+
```
93+
94+
### 性能优化
95+
96+
#### 构建优化
97+
- **代码分割**: 自动的路由级代码分割
98+
- **图片优化**: 自动图片压缩和 WebP 转换
99+
- **CSS 优化**: 自动 CSS 压缩和去重
100+
- **预加载**: 关键资源预加载
101+
102+
#### 运行时优化
103+
- **懒加载**: 图片和组件懒加载
104+
- **缓存策略**: 静态资源长期缓存
105+
- **CDN 支持**: 静态资源 CDN 分发
106+
107+
### 安全性考虑
108+
109+
- **内容安全策略**: 配置 CSP 头部
110+
- **XSS 防护**: MDX 内容安全渲染
111+
- **依赖安全**: 定期更新依赖包
112+
- **构建安全**: 构建过程中的安全检查
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# 需求文档
2+
3+
## 介绍
4+
5+
将现有的基于 MkDocs 的文档系统重构为基于 Docusaurus 的现代化文档网站,提供极具科技感的视觉体验和本地预览功能。
6+
7+
## 需求
8+
9+
### 需求 1 - Docusaurus 文档系统迁移
10+
11+
**用户故事:** 作为开发者,我希望将现有的 MkDocs 文档迁移到 Docusaurus,以获得更现代化的文档体验和更好的维护性。
12+
13+
#### 验收标准
14+
15+
1. When 执行文档构建命令时,系统应当成功生成基于 Docusaurus 的静态网站
16+
2. When 访问文档网站时,系统应当展示所有现有的文档内容,包括 API 参考、架构说明、训练指南等
17+
3. When 浏览文档时,系统应当保持原有的导航结构和内容组织方式
18+
4. When 查看 Mermaid 图表时,系统应当正确渲染所有现有的架构图和流程图
19+
20+
### 需求 2 - 科技感视觉设计
21+
22+
**用户故事:** 作为用户,我希望文档网站具有极具科技感的视觉风格,提供现代化的用户体验。
23+
24+
#### 验收标准
25+
26+
1. When 访问网站时,系统应当展示深色主题为主的科技感配色方案
27+
2. When 浏览页面时,系统应当提供流畅的动画效果和现代化的 UI 组件
28+
3. When 查看代码块时,系统应当使用语法高亮和现代化的代码展示样式
29+
4. When 使用导航时,系统应当提供直观的侧边栏和顶部导航体验
30+
5. When 在移动设备上访问时,系统应当提供响应式的移动端体验
31+
32+
### 需求 3 - 本地预览功能
33+
34+
**用户故事:** 作为开发者,我希望通过 Makefile 命令轻松启动本地文档预览服务。
35+
36+
#### 验收标准
37+
38+
1. When 执行 `make docs-dev` 时,系统应当启动本地开发服务器并自动打开浏览器
39+
2. When 修改文档内容时,系统应当自动重新加载页面显示最新内容
40+
3. When 执行 `make docs-build` 时,系统应当构建生产版本的静态文件
41+
4. When 执行 `make docs-serve` 时,系统应当启动生产版本的本地预览服务
42+
43+
### 需求 4 - 内容增强
44+
45+
**用户故事:** 作为用户,我希望文档网站提供增强的内容展示功能,提升阅读体验。
46+
47+
#### 验收标准
48+
49+
1. When 查看 API 文档时,系统应当提供交互式的 API 示例和代码片段
50+
2. When 浏览架构文档时,系统应当支持可交互的 Mermaid 图表
51+
3. When 搜索内容时,系统应当提供快速准确的全文搜索功能
52+
4. When 查看代码示例时,系统应当提供一键复制功能
53+
5. When 浏览长文档时,系统应当提供目录导航和回到顶部功能

0 commit comments

Comments
 (0)