-
Notifications
You must be signed in to change notification settings - Fork 11
/
docusaurus.config.js
227 lines (221 loc) · 6.13 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
// @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');
// @ts-ignore
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'DevStream',
tagline: 'DevStream: the open-source DevOps toolchain manager (DTM)',
url: 'https://www.devstream.io',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
favicon: 'img/favicon.png',
organizationName: 'devstream-io', // Usually your GitHub org/user name.
projectName: 'website', // Usually your repo name.
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: false, // disable the docs plugin
blog: {
showReadingTime: true,
// Please change this to your repo.
editUrl: 'https://github.com/devstream-io/website/tree/main/',
blogSidebarCount: 100,
blogSidebarTitle: 'All our blogs',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
googleAnalytics: {
trackingID: 'G-G32ZXY6QTC',
anonymizeIP: true,
},
gtag: {
trackingID: 'G-G32ZXY6QTC',
anonymizeIP: true,
},
}),
],
[
'@docusaurus/plugin-google-gtag',
{
trackingID: 'G-G32ZXY6QTC',
anonymizeIP: true,
},
],
],
plugins: [
[
'@docusaurus/plugin-content-docs',
{
id: 'community',
path: 'community',
routeBasePath: 'community',
sidebarPath: require.resolve('./sidebarsCommunity.js'),
},
],
function tailwindcss() {
return {
name: 'docusaurus-tailwindcss',
configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push(require('tailwindcss'));
postcssOptions.plugins.push(require('autoprefixer'));
postcssOptions.plugins.push(require('postcss-gap-properties'));
return postcssOptions;
},
};
},
// @ts-ignore
customizedSvgo,
],
i18n: {
defaultLocale: 'en',
locales: ['en', 'zh'],
localeConfigs: {
en: {
htmlLang: 'en-GB',
},
// You can omit a locale (e.g. fr) if you don't need to override the defaults
fa: {
direction: 'rtl',
},
},
},
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: 'DevStream',
logo: {
alt: 'DevStream Logo',
src: 'img/logo-1024.png',
},
items: [
{
href: 'https://docs.devstream.io',
position: 'left',
label: 'Docs',
},
{
type: 'doc',
docId: 'index',
position: 'left',
label: 'Community',
docsPluginId: 'community',
},
{
href: 'https://blog.devstream.io',
label: 'Blog',
position: 'left',
},
{
href: 'https://medium.com/devstream',
position: 'left',
label: 'Medium',
},
{
href: 'https://github.com/devstream-io/devstream',
label: 'GitHub',
position: 'left',
},
{
type: 'localeDropdown',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Docs',
href: 'https://docs.devstream.io',
},
],
},
{
title: 'Community',
items: [
{
label: 'Slack',
href: 'https://cloud-native.slack.com/archives/C03LA2B8K0A',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
href: 'https://blog.devstream.io',
},
{
label: 'GitHub',
href: 'https://github.com/devstream-io/devstream',
},
],
},
],
copyright: `
<img style="height:50px; margin-bottom: 10px; margin-top: 10px" alt="Cloud Native Computing Foundation" src= "/img/cncf-white-logo.svg" />
<br />
We are a Cloud Native Computing Foundation sandbox project.
<br />
<strong>© Copyright The DevStream Authors ${new Date().getFullYear()}</strong>
<br />
<br />
© ${new Date().getFullYear()} The Linux Foundation. All rights reserved. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see our <a href="https://www.linuxfoundation.org/trademark-usage/"> Trademark Usage</a> page.
`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};
function customizedSvgo() {
return {
name: 'docusaurus-svgo',
configureWebpack(config) {
// allow svgr to use svgo config file
for (const rule of config.module.rules) {
if (
typeof rule === 'object' &&
rule.test.toString() === '/\\.svg$/i'
) {
for (const nestedRule of rule.oneOf) {
if (nestedRule.use instanceof Array) {
for (const loader of nestedRule.use) {
if (
typeof loader === 'object' &&
loader.loader === require.resolve('@svgr/webpack')
) {
if (typeof loader.options === 'object') {
loader.options.svgoConfig = null;
}
}
}
}
}
}
}
return {
mergeStrategy: {
'module.rules': 'replace',
},
module: {
rules: config.module.rules,
},
};
},
};
}
module.exports = config;