forked from Cubic-Project/NitWikit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocusaurus.config.ts
More file actions
429 lines (411 loc) · 13.3 KB
/
docusaurus.config.ts
File metadata and controls
429 lines (411 loc) · 13.3 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
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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
import type { Options as PresetClassicOptions } from "@docusaurus/preset-classic";
import type { Config } from "@docusaurus/types";
import * as path from "path";
import { themes as prismThemes } from "prism-react-renderer";
const IS_CHINA_SITE = process.env.CHINA === "true";
const ICP_LICENSE = process.env.ICP_LICENSE;
const config: Config = {
future: {
v4: true,
experimental_faster: {
rspackBundler: true, // required flag
rspackPersistentCache: true // new flag
}
},
customFields: {
// 标题前缀
titlePrefix: "主页",
// 开始按钮文字
start: "快速开始 🥵",
// 标题颜色
titleColor: "white",
// 自定义swizzle配置
swizzleConfig: {
enabled: true,
components: {
"theme/DocItem/Footer/LastUpdated": {
override: "src/plugins/theme/LastUpdate"
}
}
},
// ICP 备案号
ICP_LICENSE: ICP_LICENSE,
// 是否为中国站点
IS_CHINA_SITE: IS_CHINA_SITE
},
markdown: {
mermaid: true,
hooks: {
onBrokenMarkdownLinks: "warn"
}
},
title: "笨蛋 MC 开服教程",
tagline: "一群笨蛋编写的 Minecraft 开服教程",
favicon: "img/favicon.ico",
url: IS_CHINA_SITE ? "https://nitwikit.8aka.cn" : "https://nitwikit.8aka.org",
baseUrl: "/",
organizationName: "Cubic-Project",
projectName: "笨蛋式指南",
onBrokenLinks: "warn",
onBrokenAnchors: "warn",
i18n: {
defaultLocale: "zh-Hans",
locales: ["zh-Hans"]
},
clientModules: [
require.resolve("./src/clientModules/routeModules.js"),
require.resolve("./src/clientModules/adsModules.js"),
require.resolve("./src/clientModules/themeModules.ts"),
require.resolve("./src/clientModules/tocSmoothScroll.ts")
],
presets: [
[
"classic",
{
docs: {
sidebarPath: require.resolve("./sidebars.js"),
routeBasePath: "/",
editUrl: "https://github.com/Cubic-Project/NitWikit/tree/main",
showLastUpdateAuthor: true,
showLastUpdateTime: true
},
googleTagManager: {
containerId: "GTM-MB4XZBWJ"
},
blog: false,
theme: {
customCss: [
require.resolve("./src/css/custom.css"),
require.resolve("./src/css/github.css"),
require.resolve("./src/css/ad.css"),
require.resolve("./src/css/announcement.css")
]
}
} as PresetClassicOptions
]
],
plugins: [
"docusaurus-plugin-image-zoom",
"docusaurus-plugin-sass",
path.resolve(__dirname, "src/plugins/remote-gh-viewer-plugin.ts"),
["@gracefullight/docusaurus-plugin-microsoft-clarity", { projectId: "oyfswsvfpc" }],
[
"@docusaurus/plugin-content-docs",
{
id: "docs-java",
path: "docs-java",
routeBasePath: "Java",
editUrl: "https://github.com/Cubic-Project/NitWikit/tree/main",
sidebarPath: require.resolve("./sidebars.js"),
editCurrentVersion: true,
showLastUpdateAuthor: true,
showLastUpdateTime: true
}
],
[
"@docusaurus/plugin-pwa",
{
pwaHead: [
{
tagName: "link",
rel: "icon",
href: "/img/book.png"
},
{
tagName: "link",
rel: "manifest",
href: "/manifest.json"
},
{
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/Cubic-Project/NitWikit/tree/main",
sidebarPath: require.resolve("./sidebars.js"),
editCurrentVersion: true,
showLastUpdateAuthor: true,
showLastUpdateTime: true
}
],
[
"@docusaurus/plugin-content-docs",
{
id: "docs-about",
path: "docs-about",
routeBasePath: "about",
editUrl: "https://github.com/Cubic-Project/NitWikit/tree/main",
sidebarPath: require.resolve("./sidebars.js"),
editCurrentVersion: true,
showLastUpdateAuthor: true,
showLastUpdateTime: true
}
],
path.resolve(__dirname, "src/plugins/tailwind-plugin.ts")
],
headTags: [
{
tagName: "link",
attributes: {
rel: "shortcut icon",
type: "image/x-icon",
href: "/favicon.ico"
}
},
{
tagName: "link",
attributes: {
rel: "preconnect",
href: "https://fontsapi.zeoseven.com",
crossOrigin: "anonymous"
}
},
{
tagName: "link",
attributes: {
rel: "preconnect",
href: "https://D1KV1BYF3B-dsn.algolia.net",
crossOrigin: "anonymous"
}
},
{
tagName: "link",
attributes: {
rel: "preconnect",
href: "https://giscus.app",
crossOrigin: "anonymous"
}
}
],
themeConfig: {
// Giscus 评论功能在 CHINA 环境变量设置时禁用
giscus: {
repo: "Cubic-Project/NitWikit",
repoId: "R_kgDOQWQ-Ng",
category: "General",
categoryId: "DIC_kwDOQWQ-Ns4Cx2No"
},
zoom: {
selector: ".markdown :not(em) > img",
background: {
light: "rgb(255, 255, 255)",
dark: "rgb(36 36 36 / 80%)"
}
},
// 标题渲染范围
tableOfContents: {
minHeadingLevel: 2,
maxHeadingLevel: 5
},
docs: {
sidebar: {
autoCollapseCategories: true
}
},
image: "img/docusaurus-social-card.jpg",
metadata: [{ name: "keywords", content: "Minecraft, 开服教程, MC, 开服, 插件, 联机, 我的世界" }],
navbar: {
title: "Cubic Wiki",
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: "docSidebar",
sidebarId: "tutorialSidebar",
position: "left",
label: "关于我们",
docsPluginId: "docs-about"
},
// 搜索框
{
type: "search",
position: "right"
},
// GitHub
{
href: "https://github.com/Cubic-Project/NitWikit",
className: "header-github-link",
position: "right"
}
// 顶部导航栏显示切换语言按钮
// {
// type: 'localeDropdown',
// position: 'right',
// },
]
},
// 底部链接
footer: {
style: "dark",
links: [
{
title: "文档",
items: [
{
label: "Docusaurus 主题",
to: "https://nitwikit.8aka.org"
},
{
label: "VitePress 主题",
to: "https://nitwikit2.8aka.org"
},
{
label: "GitHub",
href: "https://github.com/Cubic-Project/NitWikit"
}
]
},
{
title: "交流",
items: [
{
label: "QQ 群",
href: "https://qm.qq.com/q/UyurWW3zyI"
}
]
},
{
title: "友链",
items: [
{
label: "服主资源导航页",
href: "http://mcnav.cn"
},
{
label: "CSKB 日冕知识库",
href: "https://kb.corona.studio"
},
{
label: "McRes 灵依资源站",
href: "https://mcres.cn/"
},
{
label: "Tinksp 资源站",
href: "https://www.tinksp.com"
},
{
label: "MCNav",
href: "https://www.mcnav.net"
}
]
}
],
// 底部版权信息
copyright: `Copyright © ${new Date().getFullYear()} <b>Cubic-Project</b>, All Rights Reserved. | Web Design By Lythrilla and Cubic-Project`
},
// 深浅主题
prism: {
theme: prismThemes.vsLight,
darkTheme: prismThemes.vsDark,
additionalLanguages: [
"java",
"kotlin",
"groovy",
"scala",
"bash",
"powershell",
"python",
"ruby",
"php",
"go",
"rust",
"c",
"cpp",
"csharp",
"sql",
"json",
"yaml",
"toml",
"css",
"scss",
"less",
"javascript",
"typescript",
"jsx",
"tsx",
"markup",
"markdown",
"nginx",
"docker",
"diff"
],
defaultLanguage: "plaintext",
magicComments: [
{
className: "theme-code-block-highlighted-line",
line: "highlight-next-line",
block: { start: "highlight-start", end: "highlight-end" }
},
{
className: "code-block-error-line",
line: "error-next-line",
block: { start: "error-start", end: "error-end" }
}
]
},
announcementBar: {
id: "qq-group-notice",
content:
'Cubic Wiki 新的 QQ 交流群 <a target="_blank" rel="noopener noreferrer" href="https://qm.qq.com/q/UyurWW3zyI"><strong>1074062482</strong></a>',
backgroundColor: "#25a06e",
textColor: "white",
isCloseable: false
},
// 颜色随系统切换
colorMode: {
defaultMode: "light",
disableSwitch: false,
respectPrefersColorScheme: true
},
// 搜索
algolia: {
appId: "D1KV1BYF3B",
apiKey: "4bb3573e59f2c49f30f057ce54edab3f",
indexName: "yizhan",
askAi: {
assistantId: "8JdNEmIpzb5T",
indexName: "NITWIKIT BOT",
apiKey: "8730c526c66126ee3424fe3e8647d825",
appId: "D1KV1BYF3B"
},
insights: true
},
mermaid: {
theme: { light: "neutral", dark: "dark" }
}
},
themes: ["@docusaurus/theme-mermaid"]
};
export default config;