Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit 4fadc67

Browse files
authored
Merge pull request #30 from YumeYuka/v2
refactor: 重构项目配置和样式
2 parents 36a6eb9 + e524381 commit 4fadc67

16 files changed

Lines changed: 1275 additions & 380 deletions

File tree

.vitepress/config.mjs

Lines changed: 262 additions & 265 deletions
Large diffs are not rendered by default.

.vitepress/config/head.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import type { HeadConfig } from "vitepress";
2+
3+
export const head: HeadConfig[] = [
4+
// --- Google Fonts ---
5+
["link", { rel: "preconnect", href: "https://fonts.googleapis.cn", crossorigin: "" }],
6+
["link", { rel: "dns-prefetch", href: "https://fonts.googleapis.cn" }],
7+
["link", { rel: "preconnect", href: "https://fonts.gstatic.cn", crossorigin: "" }],
8+
["link", { rel: "dns-prefetch", href: "https://fonts.gstatic.cn" }],
9+
["link", { rel: "stylesheet", href: "https://fonts.googleapis.cn/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap" }],
10+
11+
// --- 基础和SEO元数据 ---
12+
["link", { rel: "icon", href: "source/images/logo.png" }],
13+
["meta", { name: "description", content: "AstrBot" }],
14+
[
15+
"meta",
16+
{ name: "viewport", content: "width=device-width, initial-scale=1.0" },
17+
],
18+
19+
/* // --- Open Graph (OG) 协议元数据 (用于社交媒体分享) ---
20+
["meta", { property: "og:type", content: "website" }],
21+
["meta", { property: "og:locale", content: "zh_CN" }],
22+
["meta", { property: "og:title", content: "AstrBot" }],
23+
["meta", { property: "og:description", content: "AstrBot" }],
24+
["meta", { property: "og:url", content: "https://docs.astrbot.app" }],
25+
["meta", { property: "og:site_name", content: "AstrBot" }],
26+
[
27+
"meta",
28+
{
29+
property: "og:image",
30+
content: "/",
31+
},
32+
],
33+
[
34+
"meta",
35+
{ property: "og:image:alt", content: "AstrBot" },
36+
],
37+
["meta", { property: "og:image:width", content: "1200" }],
38+
["meta", { property: "og:image:height", content: "630" }],
39+
["meta", { property: "og:image:type", content: "image/png" }],
40+
41+
// --- Twitter Card 元数据 ---
42+
["meta", { name: "twitter:card", content: "summary_large_image" }],
43+
["meta", { name: "twitter:site", content: "@AstrBot" }],*/
44+
45+
];

.vitepress/config/sidebar.ts

Lines changed: 268 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,268 @@
1+
import { defineConfig, type DefaultTheme } from "vitepress";
2+
3+
export const sidebar: DefaultTheme.Config['sidebar'] = [
4+
{
5+
text: "简介",
6+
items: [
7+
{ text: "什么是 AstrBot", link: "/what-is-astrbot" },
8+
{ text: "社区", link: "/community" },
9+
{ text: "常见问题", link: "/faq" },
10+
],
11+
},
12+
{
13+
text: "开源之夏",
14+
base: "/ospp",
15+
collapsed: false,
16+
items: [
17+
{ text: "OSPP 2025", link: "/2025" },
18+
],
19+
},
20+
{
21+
text: "部署",
22+
base: "/deploy",
23+
collapsed: false,
24+
items: deploy()
25+
},
26+
{
27+
text: "配置",
28+
base: "/config",
29+
collapsed: false,
30+
items: config()
31+
},
32+
{
33+
text: "使用",
34+
base: "/use",
35+
collapsed: false,
36+
items: use(),
37+
},
38+
{
39+
text: "开发",
40+
base: "/dev",
41+
collapsed: false,
42+
items: [
43+
{
44+
text: "核心代码解释",
45+
base: "/dev/core",
46+
collapsed: true,
47+
items: [
48+
{ text: "整体架构", link: "/overall_architecture" },
49+
{ text: "运行流程", link: "/overall_operation_process" },
50+
],
51+
},
52+
{
53+
text: "插件开发",
54+
base: "/dev/star",
55+
collapsed: true,
56+
items: dev_star()
57+
},
58+
{
59+
text: "接入平台适配器",
60+
link: "/plugin-platform-adapter",
61+
},
62+
],
63+
},
64+
{
65+
text: "其他",
66+
base: "/others",
67+
collapsed: false,
68+
items: [
69+
{
70+
text: "配置文件-大语言模型提供商",
71+
link: "/provider",
72+
},
73+
{
74+
text: "配置文件-消息平台适配器",
75+
link: "/platform",
76+
},
77+
{
78+
text: "自部署文转图",
79+
link: "/self-host-t2i",
80+
},
81+
{
82+
text: "插件下载不了?试试自建 GitHub 加速服务",
83+
link: "/github-proxy",
84+
},
85+
],
86+
},
87+
];
88+
89+
function deploy(): DefaultTheme.SidebarItem[] {
90+
return [
91+
{
92+
text: "部署 AstrBot",
93+
base: "/deploy/astrbot",
94+
collapsed: true,
95+
items: [
96+
{ text: "🦈 Docker 部署", link: "/docker" },
97+
{ text: "☁️ 雨云一键云部署(NEW)", link: "/rainyun" },
98+
{ text: "💻 Windows 一键部署", link: "/windows" },
99+
{ text: "👍 手动部署", link: "/cli" },
100+
{ text: "😁 宝塔面板部署", link: "/btpanel" },
101+
{ text: "😊 CasaOS 部署", link: "/casaos" },
102+
{ text: "😌 社区提供的部署脚本", link: "/linux-one" },
103+
],
104+
},
105+
{
106+
text: "部署消息平台(协议端)",
107+
base: "/deploy/platform",
108+
collapsed: true,
109+
items: [
110+
{
111+
text: "QQ 官方接口",
112+
base: "/deploy/platform/qqofficial",
113+
collapsed: true,
114+
items: [
115+
{ text: "Webhook 方式", link: "/webhook" },
116+
{ text: "Websockets 方式", link: "/websockets" },
117+
],
118+
},
119+
{
120+
text: "QQ 个人号",
121+
base: "/deploy/platform/aiocqhttp",
122+
collapsed: true,
123+
items: [
124+
{ text: "使用 NapCat", link: "/napcat" },
125+
{ text: "使用 Lagrange", link: "/lagrange" },
126+
{ text: "使用其他端", link: "/others" },
127+
],
128+
},
129+
{ text: "企业微信", link: "/wecom" },
130+
{ text: "微信公众平台", link: "/weixin-official-account" },
131+
{
132+
text: "微信个人号",
133+
base: "/deploy/platform/wechat",
134+
collapsed: true,
135+
items: [
136+
{ text: "使用 WeChatPadPro", link: "/wechatpadpro" },
137+
{ text: "使用 Gewechat [失效]", link: "/gewechat" },
138+
],
139+
},
140+
{ text: "飞书", link: "/lark" },
141+
{ text: "钉钉", link: "/dingtalk" },
142+
{ text: "Telegram", link: "/telegram" },
143+
{ text: "Slack", link: "/slack" },
144+
{ text: "Discord", link: "/discord" },
145+
{ text: "KOOK", link: "/kook" },
146+
{ text: "VoceChat", link: "/vocechat" },
147+
],
148+
},
149+
{
150+
text: "部署好后...",
151+
link: "/when-deployed",
152+
},
153+
]
154+
}
155+
156+
function config(): DefaultTheme.SidebarItem[] {
157+
return [
158+
{
159+
text: "接入大模型服务",
160+
base: "/config/providers",
161+
collapsed: true,
162+
items: [
163+
{ text: "接入 302.AI 模型服务", link: "/302ai" },
164+
{ text: "接入 PPIO 派欧云模型服务", link: "/ppio" },
165+
{ text: "接入 OpenAI、DeepSeek 等各种模型", link: "/llm" },
166+
{
167+
text: "接入 Dify",
168+
link: "/dify",
169+
},
170+
{
171+
text: "接入 阿里云百炼应用",
172+
link: "/dashscope",
173+
},
174+
{
175+
text: "接入 Ollama 使用 DeepSeek-R1 等模型",
176+
link: "/provider-ollama",
177+
},
178+
{
179+
text: "接入 LMStudio 使用 DeepSeek-R1 等模型",
180+
link: "/provider-lmstudio",
181+
},
182+
{
183+
text: "接入 OneAPI",
184+
link: "/oneapi",
185+
},
186+
],
187+
},
188+
{
189+
text: "AstrBot 配置文件",
190+
link: "/astrbot-config",
191+
},
192+
{
193+
text: "自定义温度等模型参数",
194+
link: "/model-config",
195+
},
196+
]
197+
}
198+
199+
function use():DefaultTheme.SidebarItem[] {
200+
return [
201+
{
202+
text: "管理面板",
203+
link: "/webui",
204+
},
205+
{
206+
text: "AstrBot Star(插件)",
207+
link: "/plugin",
208+
},
209+
{
210+
text: "内置指令",
211+
link: "/command",
212+
},
213+
{
214+
text: "函数调用",
215+
link: "/function-calling",
216+
},
217+
{
218+
text: "MCP",
219+
link: "/mcp",
220+
},
221+
{
222+
text: "网页搜索",
223+
link: "/websearch",
224+
},
225+
{
226+
text: "知识库",
227+
link: "/knowledge-base",
228+
},
229+
{
230+
text: "沙箱化代码执行器(beta)",
231+
link: "/code-interpreter",
232+
},
233+
{
234+
text: "配置 Whisper 语音转文字",
235+
link: "/whisper",
236+
},
237+
{
238+
text: "配置文字转语音(TTS)",
239+
link: "/tts",
240+
},
241+
{
242+
text: "更新管理面板",
243+
link: "/update-webui",
244+
},
245+
]
246+
}
247+
248+
function dev_star():DefaultTheme.SidebarItem[] {
249+
return [
250+
{ text: "插件基础开发", link: "/plugin" },
251+
{ text: "插件数据目录", link: "/all_resources" },
252+
{
253+
text: "插件开发数据",
254+
base: "/dev/star/resources",
255+
collapsed: true,
256+
items: [
257+
{ text: "AstrMessageEvent", link: "/astr_message_event" },
258+
{ text: "AstrBotMessage", link: "/astrbot_message" },
259+
{ text: "MessageType", link: "/message_type" },
260+
{ text: "MessageMember", link: "/message_member" },
261+
{ text: "Context", link: "/context" },
262+
{ text: "Star", link: "/star" },
263+
{ text: "StarMetadata", link: "/star_metadata" },
264+
{ text: "PlatformMetadata", link: "/platform_metadata" },
265+
],
266+
},
267+
]
268+
}

.vitepress/config/theme.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import type { DefaultTheme } from 'vitepress';
2+
import { sidebar } from './sidebar';
3+
4+
export const themeConfig: DefaultTheme.Config = {
5+
6+
nav: [
7+
{ text: "主页", link: "/" },
8+
{ text: "开始", link: "/what-is-astrbot" },
9+
],
10+
sidebar,
11+
12+
logo: 'source/images/logo.png',
13+
outline: {
14+
level: 'deep',
15+
label: '目录',
16+
},
17+
darkModeSwitchLabel: '切换日光/暗黑模式',
18+
sidebarMenuLabel: '文章',
19+
returnToTopLabel: '返回顶部',
20+
21+
lastUpdated: {
22+
text: "最后更新于",
23+
},
24+
25+
docFooter: {
26+
prev: '上一篇',
27+
next: '下一篇'
28+
},
29+
30+
editLink: {
31+
pattern: 'https://github.com/YumeYuka/AstrBot-docs/edit/v2/:path',
32+
text: '不妥之处,敬请雅正'
33+
},
34+
35+
search: {
36+
provider: "local",
37+
options: {
38+
locales: {
39+
root: {
40+
translations: {
41+
button: {
42+
buttonText: "搜索文档",
43+
buttonAriaLabel: "搜索文档",
44+
},
45+
modal: {
46+
noResultsText: "无法找到相关结果",
47+
resetButtonTitle: "清除查询条件",
48+
footer: {
49+
selectText: "选择",
50+
navigateText: "切换",
51+
closeText: "关闭",
52+
},
53+
},
54+
},
55+
},
56+
},
57+
},
58+
},
59+
60+
socialLinks: [
61+
{ icon: "github", link: "https://github.com/Soulter/AstrBot" },
62+
],
63+
64+
footer: {
65+
message: 'Deployed on&nbsp' +
66+
'<a href="https://www.rainyun.com/NjY3OTQ1_" class="deployment-link" style="display: inline-flex; align-items: center;">' +
67+
'<img src="https://www.rainyun.com/img/logo.d193755d.png" width="50" alt="Rainyun Logo">' +
68+
'</a>',
69+
}
70+
}

.vitepress/theme/Sponsors.vue

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

0 commit comments

Comments
 (0)