generated from postyizhan/Wiki-Template
-
Notifications
You must be signed in to change notification settings - Fork 52
/
docusaurus.config.js
318 lines (298 loc) · 8.1 KB
/
docusaurus.config.js
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
// @ts-check
// `@type` JSDoc annotations allow editor autocompletion and type checking
// (when paired with `@ts-check`).
// There are various equivalent ways to declare your Docusaurus config.
// See: https://docusaurus.io/docs/api/docusaurus-config
import { themes as prismThemes } from "prism-react-renderer";
/** @type {import('@docusaurus/types').Config} */
const config = {
future: {
experimental_faster: true,
},
customFields: {
// 标题前缀
titlePrefix: "主页",
// 开始按钮文字
start: "快速开始 🥵",
},
markdown: {
mermaid: true,
},
title: '笨蛋 MC 开服教程',
tagline: '一群笨蛋们写的 Minecraft 开服教程',
favicon: 'img/favicon.ico',
// Set the production url of your site here
url: 'https://nitwikit.yizhan.wiki',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'postyizhan', // Usually your GitHub org/user name.
projectName: '笨蛋式指南', // Usually your repo name.
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
onBrokenAnchors: 'warn',
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'zh-Hans',
locales: ['zh-Hans'],
},
clientModules: [
require.resolve('./src/clientModules/routeModules.js')
],
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
routeBasePath: '/',
editUrl: 'https://github.com/8aka-Team/NitWikit/tree/main',
showLastUpdateAuthor: true,
showLastUpdateTime: true,
},
blog: false,
theme: {
customCss: [
require.resolve('./src/css/custom.css'),
],
},
}),
],
],
plugins: [
'docusaurus-plugin-image-zoom',
'docusaurus-plugin-sass',
[
"@gracefullight/docusaurus-plugin-microsoft-clarity",
{ projectId: "oyfswsvfpc" },
],
[
'@docusaurus/plugin-content-docs',
{
id: 'docs-java',
path: 'docs-java',
routeBasePath: 'Java',
editUrl: 'https://github.com/8aka-Team/NitWikit/tree/main',
sidebarPath: require.resolve('./sidebars.js'),
editCurrentVersion: true,
showLastUpdateAuthor: true,
showLastUpdateTime: true,
}],[
'@docusaurus/plugin-pwa',
{
debug: true,
offlineModeActivationStrategies: [
'appInstalled',
'standalone',
'queryString',
],
pwaHead: [
{
tagName: 'link',
rel: 'icon',
href: '/img/book.png',
},
{
tagName: 'link',
rel: 'manifest',
href: '/manifest.json', // your PWA manifest
},
{
tagName: 'meta',
name: 'theme-color',
content: 'rgb(37, 194, 160)',
},
],
},
],
[
'@docusaurus/plugin-content-docs',
{
id: 'docs-bedrock',
path: 'docs-bedrock',
routeBasePath: 'Bedrock',
editUrl: 'https://github.com/postyizhan/NitWikit/tree/main',
sidebarPath: require.resolve('./sidebars.js'),
editCurrentVersion: true,
showLastUpdateAuthor: true,
showLastUpdateTime: true,
},
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
giscus: {
repo: '8aka-Team/NitWikit',
repoId: 'R_kgDOLkVR-A',
category: 'Announcements',
categoryId: 'DIC_kwDOLkVR-M4CkTAe'
},
zoom: {
selector: '.markdown :not(em) > img',
background: {
light: 'rgb(255, 255, 255)',
dark: 'rgb(50, 50, 50)',
},
},
// 标题渲染范围
tableOfContents: {
minHeadingLevel: 2,
maxHeadingLevel: 5,
},
// Replace with your project's social card
// sidebar自动折叠
docs: {
sidebar: {
autoCollapseCategories: true,
},
},
image: 'img/docusaurus-social-card.jpg',
metadata: [
{ name: '开服教程', content: '一群笨蛋们写的 Minecraft 开服教程' },
{ name: 'MC教程', content: '一群笨蛋们写的 Minecraft 开服教程' },
],
navbar: {
title: 'NitWikit',
logo: {
alt: 'Logo',
src: 'img/book.png',
},
hideOnScroll: true,
items: [
{
type: 'doc',
docId: 'intro',
position: 'left',
label: '通用',
},
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Java',
docsPluginId: 'docs-java'
},
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'Bedrock',
docsPluginId: 'docs-bedrock'
},
// 搜索框
{
type: 'search',
position: 'right',
},
// GitHub
{
href: "https://github.com/8aka-Team/NitWikit",
className: "header-github-link",
position: "right",
},
// 顶部导航栏显示切换语言按钮
// {
// type: 'localeDropdown',
// position: 'right',
// },
],
},
// 底部链接
footer: {
style: 'dark',
links: [
{
title: '文档',
items: [
{
label: '驿站主页',
to: 'https://yizhan.wiki',
},
{
label: 'Docusaurus 主题',
to: 'https://nitwikit.yizhan.wiki',
},
{
label: 'VitePress 主题',
to: 'https://nitwikit2.yizhan.wiki',
},
{
label: 'GitHub',
href: 'https://github.com/8aka-Team/NitWikit',
},
],
},
{
title: '交流',
items: [
{
label: 'QQ 群',
href: 'https://qm.qq.com/q/dENGavSflK',
},
],
},
{
title: '友链',
items: [
{
label: '服主资源导航页',
href: 'http://mcnav.fun',
},
{
label: 'CSKB 日冕知识库',
href: 'https://kb.corona.studio',
},
{
label: 'McRes 灵依资源站',
href: 'https://mcres.cn/',
},
{
label: 'Tinksp 资源站',
href: 'https://www.tinksp.com',
},
],
},
],
// 底部版权信息
copyright: `Copyright © ${new Date().getFullYear()} <b>postyizhan</b>, All Rights Reserved.`,
},
// 深浅主题
prism: {
theme: prismThemes.vsLight,
darkTheme: prismThemes.vsDark,
},
// 颜色随系统切换
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: true,
},
// 搜索
algolia: {
// The application ID provided by Algolia
appId: 'D1KV1BYF3B',
// Public API key: it is safe to commit it
apiKey: '4bb3573e59f2c49f30f057ce54edab3f',
indexName: 'yizhan',
},
mermaid: {
theme: { light: "neutral", dark: "dark" },
},
}),
themes: [
'@docusaurus/theme-mermaid'
],
scripts: [
{
src: '/autoload.js',
defer: true,
},
],
};
export default config;