Skip to content

Commit 1035aed

Browse files
committed
feat: wiki pages
1 parent 47c226e commit 1035aed

5 files changed

Lines changed: 47 additions & 4 deletions

File tree

config/projects-data.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
"apiDocPath": "bella-openapi",
1212
"link": "https://api.bella.top/",
1313
"documentationLink": "/docs/bella-openapi/intro",
14+
"deepwiki": "https://wiki.bella.top/LianjiaTech/bella-openapi?type=github&language=zh",
15+
"en_deepwiki": "https://wiki.bella.top/LianjiaTech/bella-openapi?type=github&language=en",
1416
"dependencies": [
1517
{
1618
"project": "bella-general-infer",

docusaurus.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ const config: Config = {
8383
position: 'left',
8484
to: '/api-viewer',
8585
},
86+
{
87+
label: 'DeepWiki',
88+
position: 'left',
89+
href: 'https://wiki.bella.top/wiki/projects',
90+
},
8691
// GitHub点赞按钮
8792
{
8893
type: 'html',

src/components/HomepageFeatures/index.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ interface Project {
2929
link?: string;
3030
apiDocPath?: string;
3131
documentationLink?: string;
32+
deepwiki?: string;
33+
en_deepwiki?: string;
3234
dependency?: Dependency[];
3335
dependencies?: Dependency[];
3436
}
@@ -343,6 +345,21 @@ const ArchitectureDiagram: React.FC<{
343345
</a>
344346
)}
345347

348+
{((currentLocale === 'en' && project.en_deepwiki) || (currentLocale !== 'en' && project.deepwiki)) && (
349+
<a
350+
href={currentLocale === 'en' ? project.en_deepwiki : project.deepwiki}
351+
target="_blank"
352+
rel="noopener noreferrer"
353+
className={styles.deepwikiButton}
354+
>
355+
{translate({
356+
id: 'project.deepwiki.button',
357+
message: 'DeepWiki',
358+
description: 'DeepWiki button'
359+
})}
360+
</a>
361+
)}
362+
346363
{project.status === 'released' && (
347364
<>
348365
{project.link && (

src/components/HomepageFeatures/styles.module.css

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@
608608
margin-bottom: 1.5rem;
609609
}
610610

611-
.githubButton, .visitButton, .docsButton {
611+
.githubButton, .visitButton, .docsButton, .deepwikiButton {
612612
font-size: 0.875rem;
613613
padding: 0.5rem 1rem;
614614
border-radius: 6px;
@@ -649,6 +649,16 @@
649649
background-color: #2563eb;
650650
}
651651

652+
.deepwikiButton {
653+
background-color: #8b5cf6;
654+
color: white;
655+
border: 1px solid #8b5cf6;
656+
}
657+
658+
.deepwikiButton:hover {
659+
background-color: #7c3aed;
660+
}
661+
652662
.dependencySection {
653663
margin-top: 1.5rem;
654664
}
@@ -1000,7 +1010,7 @@
10001010
align-items: stretch;
10011011
}
10021012

1003-
.githubButton, .visitButton, .docsButton {
1013+
.githubButton, .visitButton, .docsButton, .deepwikiButton {
10041014
margin-bottom: 0.5rem;
10051015
font-size: 0.85rem;
10061016
padding: 0.4rem 0.6rem;

start.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
"apiDocPath": "your-project-api-path", // OpenAPI Json文件的存放路径,统一存放在 /static/openapi目录下,此处不需要填写目录前缀,例如Openapi Json文件位于 /static/openapi/bella-openapi目录下,此处应填bella-openapi,如不提供API Doc页面则不需要填写
5858
"link": "https://your-project-url/", // 项目的线上体验链接,如不存在则不需要填写
5959
"documentationLink": "/docs/your-project/intro", // 文档链接,统一为 /docs/{your-project}/intro
60+
"deepwiki": "https://wiki.bella.top/{owner}/{repo-name}?type=github&language=zh", // 项目的wiki链接,如不存在则不需要填写
61+
"en_deepwiki": "https://wiki.bella.top/{owner}/{repo-name}?type=github&language=en", // 项目的英文wiki链接,如不存在则不需要填写
6062
"dependencies": [ // 与其他项目的依赖关系
6163
{
6264
"project": "dependent-project-id",
@@ -116,15 +118,22 @@ const sidebars: SidebarsConfig = {
116118
2. 确保在 `projects-data.json` 中设置了正确的 `apiDocPath`
117119
3. 运行 `npm run generate-api-docs` 命令生成对应的 API 文档页面,直接执行`npm run start``npm run build`时也会自动执行该命令。
118120

119-
### 5. 架构图显示效果
121+
### 5. 生成DeepWiki
122+
如果需要生成DeepWiki:
123+
- 使用 https://wiki.bella.top 进行生成
124+
- 生成后的文档链接为:https://wiki.bella.top/{owner}/{repo-name}?type=github&language={zh|en}
125+
- 使用时,需获联系 <a href="https://github.com/szl97">@saizhuolin</a> 获取授权码
126+
- 注意:生成时wiki pages时,不可关闭浏览器页面,否则会生成失败
127+
128+
### 6. 架构图显示效果
120129

121130
项目架构图会根据 `projects-data.json` 中的配置自动渲染。已发布的项目会有以下特殊显示:
122131

123132
1. 在架构图中使用绿色边框高亮显示
124133
2. 显示"已发布"标签
125134
3. 在项目详情面板中显示"快速体验"和"查看文档"按钮,"快速体验"配置link属性时会显示
126135

127-
### 6. 注意事项
136+
### 7. 注意事项
128137

129138
1. 项目 ID 应该使用连字符命名(如 `bella-openapi`
130139
2. 确保所有必填字段都已正确填写

0 commit comments

Comments
 (0)