-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocusaurus.config.ts
More file actions
153 lines (141 loc) · 4.87 KB
/
docusaurus.config.ts
File metadata and controls
153 lines (141 loc) · 4.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
// 注意:此配置文件运行在Node.js环境,不要使用浏览器API或JSX语法
const config: Config = {
// 基础配置
title: 'FCL_CE教程', // 网站标题(显示在浏览器标签页和网站头部)
tagline: '专注于 Minecraft Java Edition for Android 的启动器文档', // 网站标语(通常显示在首页的副标题位置)
favicon: 'img/favicon.png', // 浏览器标签页图标
// 部署配置
url: 'https://docs.lemwood.cn', // 生产环境访问地址
baseUrl: '/', // 网站的基础路径(GitHub Pages部署时通常设为 '/项目名/')
// GitHub Pages部署配置(如果不用GitHub Pages可忽略)
organizationName: 'leemwood', // GitHub组织/用户名
projectName: 'fcl-docs', // GitHub仓库名
// 构建配置
onBrokenLinks: 'warn', // 遇到损坏链接时抛出错误(可选值:ignore | warn | throw)
// Markdown 配置
markdown: {
hooks: {
onBrokenMarkdownLinks: 'warn', // 遇到损坏的Markdown链接时警告
},
},
// 国际化配置
i18n: {
defaultLocale: 'zh-Hans', // 默认语言
locales: ['zh-Hans'], // 支持的语言列表(如需中文支持可添加 'zh-Hans')
},
// 预设配置
presets: [
[
'classic',
{
// 文档模块配置
docs: {
sidebarPath: './sidebars.ts', // 侧边栏配置文件路径
editUrl: // 文档编辑链接(建议改为你的仓库地址)
'https://github.com/leemwood/fcl-docs/tree/main/packages/create-docusaurus/templates/shared/',
},
// 博客模块配置
blog: {
showReadingTime: true, // 显示阅读时间
feedOptions: { // RSS订阅配置
type: ['rss', 'atom'],
xslt: true,
},
editUrl: // 博客编辑链接(建议改为你的仓库地址)
'https://github.com/leemwood/fcl-docs/tree/main/packages/create-docusaurus/templates/shared/',
// 博客内容校验配置
onInlineTags: 'warn', // 行内标签警告
onInlineAuthors: 'warn', // 行内作者警告
onUntruncatedBlogPosts: 'warn', // 未截断的博客文章警告
},
// 主题配置
theme: {
customCss: './src/css/custom.css', // 自定义CSS文件路径
},
} satisfies Preset.Options,
],
],
// 主题配置
themeConfig: {
image: 'img/favicon.png', // 社交媒体分享卡片图片
navbar: { // 导航栏配置
title: 'FCL_CE教程', // 导航栏标题
logo: {
alt: 'FCL_CE教程', // logo的alt文本(无障碍访问需要)
src: 'img/favicon.png', // logo图片路径
},
items: [ // 导航项配置
{
type: 'docSidebar', // 文档侧边栏类型
sidebarId: 'tutorialSidebar', // 对应侧边栏ID
position: 'left', // 显示位置
label: '文档', // 显示文本
},
{to: '/blog', label: '博客', position: 'left'}, // 博客链接
{
href: 'https://github.com/leemwood/fcl-docs',
label: 'GitHub',
position: 'right', // 右侧显示
},
],
},
footer: {
style: 'dark',
logo: {
alt: 'Logo',
src: 'img/favicon.png',
href: '/',
width: 60,
height: 60,
},
links: [
{
title: '文档',
items: [
{ label: '快速开始', to: '/docs' },
{ label: 'FCL 启动器', to: '/docs/fcl/intro' },
{ label: '插件', to: '/docs/plugins' },
],
},
{
title: '社区',
items: [
{
label: 'GitHub',
href: 'https://github.com/leemwood/fcl-docs',
},
{
label: 'QQ群',
href: '/docs/qqgroup',
},
{
label: '博客',
href: '/blog',
},
],
},
],
copyright: `
<div style="margin-top: 2rem; border-top: 1px solid #444; padding-top: 1rem">
<div>
版权所有 © ${new Date().getFullYear()} by fcl玩家社区 ·
</div>
<div>
此网站基于 <a href="https://docusaurus.io/" target="_blank" rel="noopener noreferrer">Docusaurus</a>开发.
</div>
<div>
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer">新ICP备2024015133号-3</a>
</div>
</div>
`,
},
prism: { // 代码块高亮配置
theme: prismThemes.github, // 亮色主题
darkTheme: prismThemes.dracula, // 暗色主题
},
} satisfies Preset.ThemeConfig,
};
export default config;