-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurus.config.js
274 lines (264 loc) · 7.88 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
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const {themes} = require('prism-react-renderer');
const lightTheme = themes.github;
const darkTheme = themes.dracula;
const minecraftTypeNames = [
'common',
'server',
'server-ui',
'server-admin',
'server-net',
'server-editor',
'server-gametest',
];
/** @type {import('@docusaurus/types').Config} */
const config = {
title: '基岩技术文刊 | Bedrock Tech Journal',
tagline: 'Minecraft基岩版技术文刊站点',
favicon: 'img/logo.png',
// Set the production url of your site here
url: ' https://abbottmc.github.io/',
// 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: 'AbbottMc', // Usually your GitHub org/user name.
projectName: 'BedrockTechWeekly', // Usually your repo name.
onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',
markdown: {
format: 'detect'
},
// 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',
'en'],
localeConfigs: {
en: {
htmlLang: 'en'
}
}
},
plugins: [
...minecraftTypeNames.map((typeName) => {
return [
'docusaurus-plugin-typedoc',
/**
* @type {import("docusaurus-plugin-typedoc/dist/models").PluginOptions}
**/
{
id: `preview-${typeName}`,
entryPoints: [`./static/typedoc/preview/${typeName}.d.ts`],
tsconfig: './static/typedoc/preview/tsconfig.json',
// exclude:['/node_modules/'],
out: `./docs/sapi/preview/${typeName}`,
skipErrorChecking: true,
parametersFormat: 'table',
sidebar: {
pretty: true,
}
}
];
}),
...minecraftTypeNames.map((typeName) => {
return [
'docusaurus-plugin-typedoc',
// Plugin / TypeDoc options
{
id: `stable-${typeName}`,
entryPoints: [`./static/typedoc/stable/${typeName}.d.ts`],
tsconfig: './static/typedoc/stable/tsconfig.json',
// exclude:['/node_modules/'],
out: `./docs/sapi/stable/${typeName}`,
skipErrorChecking: true,
parametersFormat: 'table',
sidebar: {
categoryLabel: 'sapiStableSidebar',
collapsed: false,
position: 0,
fullNames: true,
}
}
];
})
],
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/AbbottMc/BedrockTechWeekly/tree/master',
admonitions: {
keywords: ['info', 'warn'],
// extendDefaults: true,
},
// remarkPlugins: [
// require('./src/remark/SourceTextOverlay')
// ]
},
blog: {
blogSidebarTitle: '历史周刊文章',
blogSidebarCount: 'ALL',
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/AbbottMc/BedrockTechWeekly/tree/master',
},
theme: {
customCss: [
require.resolve('./src/css/custom.css'),
require.resolve('./src/css/api_reference.css'),
require.resolve('./src/css/sapi_docs.css'),
require.resolve('./src/css/article.css'),
require.resolve('primeflex/primeflex.min.css'),
require.resolve('primeicons/primeicons.css')
]
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
colorMode: {
defaultMode: 'dark'
},
announcementBar: {
id: 'welcome',
content:
'欢迎来到基岩技术文刊站!这个站点仍在完善当中,欢迎您的<a href="https://github.com/AbbottMc/BedrockTechWeekly/issues">反馈</a>!',
backgroundColor: '#fafbfc',
textColor: '#091E42',
isCloseable: true,
},
/* docs:{
sidebar: {
hideable: true,
}
},*/
navbar: {
title: '基岩技术文刊',
logo: {
alt: '基岩技术文刊Logo',
src: 'img/logo.png',
},
items: [
// {
// to: '/blog',
// label: '周刊',
// position: 'left'
// },
{
type: 'doc',
docId: 'official_changelog/README',
position: 'left',
label: '官方日志',
},
{
type: 'dropdown',
label: '脚本文档',
position: 'left',
items: [
{
to: '/docs/sapi/stable',
label: '稳定版 [1.20.8x]',
},
{
to: '/docs/sapi/preview',
label: '预览版 [1.21.0.24]',
}
]
},
{
type: 'doc',
docId: 'changelog',
position: 'right',
label: '站点日志',
},
{
type: 'localeDropdown',
position: 'right',
/*dropdownItemsAfter: [
{
type: 'html',
value: '<hr style="margin: 0.3rem 0;">',
},
{
href: 'https://github.com/facebook/docusaurus/issues/3526',
label: 'Help Us Translate',
},
],*/
},
{
href: 'https://github.com/AbbottMc/BedrockTechWeekly',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: '文刊',
items: [
{
label: '主页',
to: '/',
},
],
},
/*{
title: '社区',
items: [
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/docusaurus',
},
{
label: 'Discord',
href: 'https://discordapp.com/invite/docusaurus',
},
{
label: 'Twitter',
href: 'https://twitter.com/docusaurus',
},
],
},*/
{
title: '更多',
items: [
{
label: '周刊',
to: '/blog',
},
{
label: 'GitHub仓库',
href: 'https://github.com/AbbottMc/BedrockTechWeekly',
},
],
},
],
copyright: `基岩技术文刊站点,由<a href="https://space.bilibili.com/15122547">乾山瑶</a>基于Docusaurus搭建.<br/>“Minecraft”是 <a href="https://www.minecraft.net/">Mojang AB</a> 的商标,在中国大陆由<a href="https://mc.163.com/">网易我的世界</a>代理管辖。本站不以任何方式隶属于 Microsoft 、 Mojang AB 或网之易吾世界公司`,
},
prism: {
theme: lightTheme,
darkTheme: darkTheme,
additionalLanguages: ['bash', 'diff', 'json'],
},
}),
};
module.exports = config;