-
Notifications
You must be signed in to change notification settings - Fork 112
/
docusaurus.config.js
398 lines (394 loc) · 12.3 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
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
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
// With JSDoc @type annotations, IDEs can provide config autocompletion
/** @type {import('@docusaurus/types').DocusaurusConfig} */
(module.exports = {
// omit unrelated docusaurus options
title: 'Apache Linkis',
tagline: 'Apache Linkis',
url: 'https://linkis.apache.org',
baseUrl: '/',
onBrokenLinks: 'ignore',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
organizationName: 'Apache Linkis', // Usually your GitHub org/user name.
projectName: 'Apache Linkis', // Usually your repo name.
i18n: {
defaultLocale: "en",
locales: ["en", "zh-CN"],
localeConfigs: {
en: {
label: "English",
direction: 'ltr',
},
'zh-CN': {
label: "简体中文",
direction: 'ltr',
},
},
},
presets: [
[
'@docusaurus/preset-classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
sidebarCollapsible: true,
editLocalizedFiles: true,
// Please change this to your repo.
editUrl: 'https://github.com/apache/linkis-website/edit/dev/',
versions: {
current: {
path: '1.7.0',
label: 'Next(1.7.0)'
},
'1.6.0': {
path: 'latest',
},
}
},
blog: {
// routeBasePath: '/',
path: 'blog',
editUrl: ({
locale,
blogDirPath,
blogPath
}) => {
if (locale !== 'en') {
return `https://github.com/apache/linkis-website/edit/dev/i18n/${locale}`;
}
return `https://github.com/apache/linkis-website/edit/dev/${blogDirPath}/${blogPath}`;
},
postsPerPage: 5,
feedOptions: {
type: 'all',
//copyright: `Copyright © ${new Date().getFullYear()} Facebook, Inc.`,
},
blogSidebarCount: 'ALL'
},
theme: {
customCss: require.resolve('./src/css/custom.scss'),
},
}),
],
],
themeConfig: {
algolia: {
appId: 'AE29KQB3IA',
apiKey: '9ca054a67ee2403605e78587a518b0d6',
indexName: 'linkis-apache'
},
colorMode: {
defaultMode: 'light',
disableSwitch: true
},
// announcementBar: {
// id: 'announcementBar-2', // Increment on change
// content: `⭐️ If you like Apache Linkis , give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/apache/linkis">GitHub</a>`,
// backgroundColor: "#BBDFFF",
// },
navbar: {
title: 'Apache Linkis',
logo: {
alt: 'Apache Linkis Logo',
src: 'img/logo.png',
},
items: [
// {
// to: '/',
// position: 'left',
// label: 'Home',
// activeBaseRegex: `^/$`,
// },
/*{
type: 'docsVersionDropdown',
position: 'right',
dropdownActiveClassDisabled: true,
dropdownItemsAfter: [
{
to: '/versions',
label: 'All versions',
},
],
},*/
{
to: '/download/main',
position: 'left',
label: 'Download',
activeBaseRegex: `/download/`,
},
{
to: '/community/how-to-subscribe',
label: 'Community',
position: 'left',
activeBaseRegex: `/community/`,
},
{
to: 'blog',
label: 'Blog',
position: 'left',
activeBaseRegex: `/blog`,
},
{
to: '/team',
label: 'Team',
position: 'left',
activeBaseRegex: `/team`,
},
// {
// to: '/blessing_wall',
// label: 'Blessing',
// position: 'left',
// activeBaseRegex: `/blessing_wall`,
// },
{
to: '/user',
label: 'Users',
position: 'left',
activeBaseRegex: `/user`,
},
{
to: 'https://docs.qq.com/doc/DUkdTTGhVSlZ0VXVt',
position: 'left',
label: 'FAQ',
activeBaseRegex: `/faq/`,
},
{
label: 'Doc',
position: 'right',
items: [
{label: '1.6.0', to: '/docs/latest/about/introduction'},
{label: '1.5.0', to: '/docs/1.5.0/about/introduction'},
{label: '1.4.0', to: '/docs/1.4.0/about/introduction'},
// {label: '1.3.1', to: '/docs/1.3.1/about/introduction'},
// {label: '1.3.0', to: '/docs/1.3.0/introduction'},
// {label: '1.2.0', to: '/docs/1.2.0/introduction'},
// {label: '1.1.1', to: '/docs/1.1.1/introduction'},
{label: 'Next(1.7.0)', to: '/docs/1.7.0/about/introduction'},
{label: 'All Version', to: '/versions'}
]
},
{
label: 'ASF',
position: 'left',
items: [{
label: "Foundation",
to: "https://www.apache.org/",
},
{
label: "License",
to: "https://www.apache.org/licenses/",
},
{
label: "Events",
to: "https://www.apache.org/events/current-event",
},
{
label: "Security",
to: "https://www.apache.org/security/",
},
{
label: "Sponsorship",
to: "https://www.apache.org/foundation/sponsorship.html",
},
{
label: "Privacy",
to: "https://privacy.apache.org/policies/privacy-policy-public.html",
},
{
label: "Thanks",
to: "https://www.apache.org/foundation/thanks.html",
},
],
},
{
href: 'https://github.com/apache/linkis',
'aria-label': 'GitHub',
className: 'header-github-link',
position: 'right',
},
{
type: "localeDropdown",
position: "right",
},
],
},
footer: {
style: 'light',
links: [{
title: 'Linkis',
items: [{
label: 'Document',
href: '/docs/latest/about/introduction',
},
{
label: 'FAQ',
href: '/faq/main',
},
{
label: 'Releases',
to: 'https://github.com/apache/linkis/releases',
},
],
},
{
title: 'Community',
items: [{
label: 'GitHub',
to: 'https://github.com/apache/linkis',
},
{
label: 'Issue Tracker',
to: 'https://github.com/apache/linkis/issues',
},
{
label: 'Pull Requests',
to: 'https://github.com/apache/linkis/pulls',
},
],
},
{
title: 'Subscribe Mailing List',
items: [{
label: 'How to Subscribe',
to: '/community/how-to-subscribe',
},
{
label: 'Subscribe Mail',
to: 'mailto:[email protected]',
},
{
label: 'Mail Archive',
to: 'https://lists.apache.org/[email protected]',
},
],
},
],
copyright: `<div><img style="height:50px" alt="Apache Software Foundation" src="/img/incubator-logo.svg" /><p style="color: #999999; padding: 0 20px 30px;font-weight:400;text-align:left">Apache Linkis is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.</p></p>
<p style="padding: 0 20px 30px;color: #999999;font-weight: 400;"> Copyright © ${new Date().getFullYear()} The Apache Software Foundation. Licensed under the Apache License, Version 2.0. Apache Linkis, Apache Incubator, Apache, the Apache feather logo, the Apache Linkis logo and the Apache Incubator project logo are trademarks of The Apache Software Foundation.</p>
<div>`,
},
prism: {
theme: require('prism-react-renderer/themes/dracula'),
darkTheme: darkCodeTheme,
},
scripts: ['/script/matomo.js'],
},
plugins: [
[
'docusaurus-plugin-less',
{
lessOptions: {
javascriptEnabled: true,
},
},
],
'docusaurus-plugin-sass',
[
'@docusaurus/plugin-content-docs',
{
id: 'community',
path: 'community',
routeBasePath: 'community',
sidebarPath: require.resolve('./sidebars.js'),
sidebarCollapsible: true,
editUrl: ({
locale,
versionDocsDirPath,
docPath
}) => {
if (locale !== 'en') {
return `https://github.com/apache/linkis-website/edit/dev/i18n/${locale}/${docPath}`;
}
return `https://github.com/apache/linkis-website/edit/dev/${versionDocsDirPath}/${docPath}`;
},
},
],
[
'@docusaurus/plugin-content-docs',
{
id: 'download',
path: 'download',
routeBasePath: 'download',
editUrl: ({
locale,
versionDocsDirPath,
docPath
}) => {
if (locale !== 'en') {
return `https://github.com/apache/linkis-website/edit/dev/i18n/${locale}/${docPath}`;
}
return `https://github.com/apache/linkis-website/edit/dev/${versionDocsDirPath}/${docPath}`;
},
},
],
[
'@docusaurus/plugin-content-docs',
{
id: 'faq',
path: 'faq',
routeBasePath: 'faq',
editUrl: ({
locale,
versionDocsDirPath,
docPath
}) => {
if (locale !== 'en') {
return `https://github.com/apache/linkis-website/edit/dev/i18n/${locale}/${docPath}`;
}
return `https://github.com/apache/linkis-website/edit/dev/${versionDocsDirPath}/${docPath}`;
},
},
],
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
// /docs/1.3.1/introduction -> /docs/1.3.1/about/introduction
{
from: '/docs/latest/introduction',
to: '/docs/latest/about/introduction',
}
],
createRedirects(existingPath) {
if (existingPath.includes('/latest')) {
return [
existingPath.replace('/latest', '/1.5.0'),
];
}
return undefined; // Return a false value: no redirect created
},
}
]
// [
// '@docusaurus/plugin-content-docs',
// {
// id: 'blog',
// path: 'blog',
// routeBasePath: 'blog',
// editUrl: ({locale, versionDocsDirPath, docPath}) => {
// if (locale !== 'en') {
// return `https://github.com/apache/linkis-website/edit/dev/i18n/${locale}/${docPath}`;
// }
// return `https://github.com/apache/linkis-website/edit/dev/${versionDocsDirPath}/${docPath}`;
// },
// },
// ],
// [
// '@docusaurus/plugin-content-docs',
// {
// id: 'blog',
// path: 'blog',
// routeBasePath: 'blog',
// editUrl: ({locale, versionDocsDirPath, docPath}) => {
// if (locale !== 'en') {
// return `https://github.com/apache/linkis-website/edit/dev/i18n/${locale}/${docPath}`;
// }
// return `https://github.com/apache/linkis-website/edit/dev/${versionDocsDirPath}/${docPath}`;
// },
// },
// ],
]
});