-
Notifications
You must be signed in to change notification settings - Fork 10
/
docusaurus.config.js
175 lines (166 loc) · 4.41 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
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const isDev = process.env.NODE_ENV === 'development';
const baseURL = '/shuvijs.org/';
const allDocHomesPaths = ['/docs/'];
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Shuvi.js',
organizationName: 'shuvijs', // Usually your GitHub org/user name.
projectName: 'shuvi', // Usually your repo name.
url: 'https://shuvijs.github.io/',
baseUrl: baseURL,
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
scripts: [`${baseURL}iconfont.js`],
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
editUrl: 'https://github.com/shuvijs/shuvijs.org/tree/master/',
},
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl: 'https://github.com/shuvijs/shuvijs.org/tree/master/',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'img/logo-og.png',
algolia: {
appId: 'M2MZN9GIKD',
apiKey: '1403f40ac7096c28c523d50476f26481',
indexName: 'shuvijs',
},
// sidebarCollapsible: false,
navbar: {
title: 'Shuvi.js',
logo: {
alt: 'Shuvi.js',
src: 'img/logo.svg',
},
items: [
{
type: 'doc',
docId: 'introduction',
position: 'right',
label: 'Docs',
},
{
type: 'doc',
docId: 'guides/index',
position: 'right',
label: 'Guides',
},
{
type: 'doc',
docId: 'reference/index',
position: 'right',
label: 'Reference',
},
{
type: 'doc',
docId: 'api/index',
position: 'right',
label: 'API',
},
{ to: '/blog', label: 'Blog', position: 'right' },
{
href: 'https://github.com/shuvijs/shuvi',
position: 'right',
className: 'header-github-link',
'aria-label': 'GitHub repository',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Tutorials',
to: 'docs/tutorials',
},
{
label: 'Guide',
to: 'docs/guides',
},
{
label: 'reference',
to: 'docs/reference',
},
{
label: 'API',
to: 'docs/api',
},
],
},
{
title: 'Social',
items: [
{
label: 'GitHub',
href: 'https://github.com/shuvijs/shuvi',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} contributors of Shuvi`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
plugins: [
[
'client-redirects',
/** @type {import('@docusaurus/plugin-client-redirects').Options} */
({
fromExtensions: ['html'],
createRedirects(routePath) {
// Redirect to /docs from /docs/introduction, as introduction has been
// made the home doc
if (allDocHomesPaths.includes(routePath)) {
return [`${routePath}/introduction`];
}
return [];
},
redirects: [],
}),
],
[
'ideal-image',
/** @type {import('@docusaurus/plugin-ideal-image').PluginOptions} */
({
quality: 70,
max: 1030,
min: 640,
steps: 2,
// Use false to debug, but it incurs huge perf costs
disableInDev: true,
}),
],
],
};
module.exports = config;