forked from electron/website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docusaurusConfig.ts
246 lines (243 loc) · 7.25 KB
/
docusaurusConfig.ts
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
import path from 'path';
import { Config } from '@docusaurus/types';
import npm2yarn from '@docusaurus/remark-plugin-npm2yarn';
import apiLabels from './src/transformers/api-labels';
import apiOptionsClass from './src/transformers/api-options-class';
import apiStructurePreviews from './src/transformers/api-structure-previews';
import fiddleEmbedder from './src/transformers/fiddle-embedder';
const config: Config = {
title: 'Electron',
tagline: 'Build cross-platform desktop apps with JavaScript, HTML, and CSS',
url: 'https://electronjs.org',
baseUrl: '/',
onBrokenLinks: 'warn',
favicon: 'assets/img/favicon.ico',
organizationName: 'electron',
projectName: 'electron',
i18n: {
defaultLocale: 'en',
locales: ['en', 'de', 'es', 'fr', 'ja', 'pt', 'ru', 'zh'],
path: 'i18n',
localeConfigs: {},
},
themeConfig: {
announcementBar: {
id: 'announcementBar',
content: `Introducing Electron Forge 6, a complete pipeline for building your Electron apps. Read more in the <strong><a target="_blank" rel="noopener noreferrer" href="https://www.electronjs.org/blog/forge-v6-release">Forge 6 announcement blog</a></strong>!`,
backgroundColor: '#A2ECFB',
isCloseable: true,
},
colorMode: {
//Default to light or dark depending on system theme.
respectPrefersColorScheme: true,
},
prism: {
theme: require('prism-react-renderer/themes/github'),
darkTheme: require('prism-react-renderer/themes/dracula'),
},
tableOfContents: {
minHeadingLevel: 2,
maxHeadingLevel: 4,
},
navbar: {
title: 'Electron',
style: 'dark',
logo: {
alt: 'Electron homepage',
src: 'assets/img/logo.svg',
},
items: [
{
label: 'Docs',
type: 'doc',
docId: 'latest/tutorial/introduction',
position: 'left',
},
{
label: 'API',
type: 'doc',
docId: 'latest/api/app',
position: 'left',
},
{ to: 'blog', label: 'Blog', position: 'left' },
{
type: 'dropdown',
label: 'Tools',
position: 'left',
items: [
{ to: 'https://electronforge.io', label: 'Electron Forge' },
{ to: 'fiddle', label: 'Electron Fiddle' },
],
},
{
type: 'dropdown',
label: 'Community',
position: 'left',
items: [
{ to: 'governance', label: 'Governance' },
{ to: 'apps', label: 'Showcase' },
{ to: 'community', label: 'Resources' },
],
},
{
href: 'https://releases.electronjs.org',
label: 'Releases',
position: 'right',
},
{
href: 'https://github.com/electron/electron',
label: 'GitHub',
position: 'right',
},
{
type: 'localeDropdown',
position: 'right',
},
],
},
footer: {
logo: {
alt: 'OpenJS Foundation Logo',
src: 'assets/img/openjsf_logo.svg',
srcDark: 'assets/img/openjsf_logo-dark.svg',
href: 'https://openjsf.org/',
},
links: [
{
title: 'Docs',
items: [
{
label: 'Getting Started',
to: '/docs/latest/',
},
{
label: 'API Reference',
to: '/docs/latest/api/app',
},
],
},
{
title: 'Checklists',
items: [
{
label: 'Performance',
to: '/docs/latest/tutorial/performance',
},
{
label: 'Security',
to: '/docs/latest/tutorial/security',
},
],
},
{
title: 'Tools',
items: [
{
label: 'Electron Forge',
to: 'https://electronforge.io',
},
{
label: 'Electron Fiddle',
to: '/fiddle',
},
],
},
{
title: 'Community',
items: [
{ label: 'Governance', to: '/governance' },
{ label: 'Resources', to: '/community' },
{
label: 'Discord',
href: 'https://discordapp.com/invite/APGC3k5yaH',
},
{
label: 'Twitter',
href: 'https://twitter.com/electronjs',
},
{
html: '<a href="https://social.lfx.dev/@electronjs" target="_blank" rel="me" class="footer__link-item">Mastodon<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" style="margin-left: 0.3rem;"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a>',
},
{
label: 'Stack Overflow',
href: 'https://stackoverflow.com/questions/tagged/electron',
},
],
},
{
title: 'More',
items: [
{
label: 'GitHub',
href: 'https://github.com/electron/electron',
},
{
label: 'Open Collective',
href: 'https://opencollective.com/electron',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} OpenJS Foundation and Electron contributors.`,
},
algolia: {
appId: 'MG3SRMK3K0',
apiKey: 'fdc2cf6080e499639d7e6b0278851ed4',
indexName: 'electronjs',
contextualSearch: true,
},
},
plugins: [
'docusaurus-plugin-sass',
path.resolve(__dirname, './src/plugins/apps'),
path.resolve(__dirname, './src/plugins/releases'),
path.resolve(__dirname, './src/plugins/fiddle'),
path.resolve(__dirname, './src/plugins/governance'),
],
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: require.resolve('./sidebars.js'),
routeBasePath: '/docs/',
editUrl: ({ docPath }) => {
const fixedPath = docPath.replace('latest/', '');
return `https://github.com/electron/electron/edit/main/docs/${fixedPath}`;
},
remarkPlugins: [
apiLabels,
apiOptionsClass,
apiStructurePreviews,
fiddleEmbedder,
[npm2yarn, { sync: true, converters: ['yarn'] }],
],
},
blog: {
// See `node_modules/@docusaurus/plugin-content-blog/src/pluginOptionSchema.ts` for full undocumented options
blogSidebarCount: 50,
blogSidebarTitle: 'Latest posts',
blogTitle: `Electron's blog`,
blogDescription: `Keep up to date with what's going on with the Electron project`,
},
theme: {
customCss: [require.resolve('./src/css/custom.scss')],
},
googleAnalytics: {
trackingID: 'UA-160365006-1',
},
},
],
],
webpack: {
jsLoader: (isServer) => ({
loader: require.resolve('esbuild-loader'),
options: {
loader: 'tsx',
format: isServer ? 'cjs' : undefined,
target: isServer ? 'node12' : 'es2017',
},
}),
},
};
export default config;