-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathdocusaurus.config.js
325 lines (313 loc) · 10.1 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
const lightCodeTheme = require('prism-react-renderer/themes/github')
const autoImportTabs = require('./src/remark/auto-import-tabs')
const fileExtSwitcher = require('./src/remark/file-ext-switcher')
const searchAndReplace = require('./src/remark/search-and-replace')
const includeCurrentVersion =
process.env.DOCS_INCLUDE_CURRENT_VERSION === 'true'
const isProduction = process.env.NODE_ENV === 'production'
/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
title: 'Wasp',
tagline:
'A simple language for developing full-stack web apps with less code.',
// url, baseUrl, organizationName, projectName and trailingSlash are set according to the
// instructions in https://docusaurus.io/docs/deployment#deploying-to-github-pages .
url: 'https://wasp.sh',
baseUrl: '/', // Should be name of repo if hosted on Github Pages, but can be just '/' if custom domain is used.
organizationName: 'wasp-lang', // Should be GitHub org/user name if hosted on Github Pages.
projectName: 'wasp', // Should be repo name if hosted on Github Pages.
trailingSlash: false,
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
stylesheets: [
'https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap',
],
themeConfig: {
announcementBar: {
id: 'LW7',
content:
'<b>Wasp v0.16 is here!</b> 🐝 <a href="/blog/2025/01/09/wasp-launch-week-8">See what\'s new ⚙️</a>',
backgroundColor: '#eab307',
textColor: '#fff',
isCloseable: false,
},
imageZoom: {
// CSS selector to apply the plugin to, defaults to '.markdown img'
//selector: '.markdown img',
// Optional medium-zoom options
// see: https://www.npmjs.com/package/medium-zoom#options
options: {
/*
margin: 24,
background: '#BADA55',
scrollOffset: 0,
container: '#zoom-container',
template: '#zoom-template',
*/
},
},
navbar: {
title: '.wasp (beta)',
logo: {
alt: 'Wasp logo',
src: 'img/wasp-logo-eqpar-circle.png',
href: 'https://wasp.sh/',
target: '_self',
},
items: [
{
type: 'docsVersion',
position: 'left',
label: 'Docs',
className: 'navbar-item-docs navbar-item-outside',
},
{
type: 'docsVersionDropdown',
position: 'left',
className: 'navbar-item-docs-version-dropdown',
},
{
to: 'blog',
label: 'Blog',
position: 'left',
},
{
href: 'https://github.com/wasp-lang/wasp',
className: 'navbar-item-github',
position: 'right',
},
{
href: 'https://twitter.com/WaspLang',
className: 'navbar-item-twitter',
position: 'right',
},
{
href: 'https://discord.gg/rzdnErX',
className: 'navbar-item-discord',
position: 'right',
},
],
},
prism: {
additionalLanguages: ['shell-session', 'haskell'],
theme: lightCodeTheme,
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Getting started',
to: 'docs',
},
{
label: 'Todo app tutorial',
to: 'docs/tutorial/create',
},
],
},
{
title: 'Community',
items: [
{
label: 'Discord',
href: 'https://discord.gg/rzdnErX',
},
],
},
{
title: 'More',
items: [
{
label: 'GitHub',
href: 'https://github.com/wasp-lang/wasp',
},
{
label: 'Contact',
to: 'docs/contact',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Wasp.`,
},
algolia: {
appId: 'RG0JSZOWH4',
apiKey: 'feaa2a25dc596d40418c82cd040e2cbe',
indexName: 'wasp-lang',
// ContextualSearch is useful when you are doing versioning,
// it searches only in v1 docs if you are searching from v1 docs.
// Therefore we have it enabled, since we have multiple doc versions.
contextualSearch: true,
},
image: 'img/wasp_twitter_cover.png',
metadata: [{ name: 'twitter:card', content: 'summary_large_image' }],
},
presets: [
[
'@docusaurus/preset-classic',
{
gtag: {
trackingID: 'GTM-PQ4JFCK',
anonymizeIP: true,
},
docs: {
sidebarPath: require.resolve('./sidebars.js'),
sidebarCollapsible: true,
editUrl: 'https://github.com/wasp-lang/wasp/edit/release/web',
remarkPlugins: [autoImportTabs, fileExtSwitcher, searchAndReplace],
// ------ Configuration for multiple docs versions ------ //
// "current" docs (under /docs) are in-progress docs, so we show them only in development.
includeCurrentVersion,
// In development, we want "current" docs to be the default docs (served at /docs),
// to make it easier for us a bit. Otherwise, by default, the latest versioned docs
// will be served under /docs.
lastVersion: includeCurrentVersion ? 'current' : undefined,
// Uncomment line below to build and show only current docs, for faster build times
// during development, if/when needed.
// onlyIncludeVersions: includeCurrentVersion ? ["current"] : undefined,
// "versions" option here enables us to customize each version of docs individually,
// and there are also other options if we ever need to customize versioned docs further.
versions: {
// We provide config for `current` only during development because otherwise
// we don't even build them (due to includeCurrentVersion above), so this config
// would cause error in that case.
...(includeCurrentVersion
? {
current: {
label: 'Next', // Label shown in the documentation to address this version of docs.
noIndex: true, // these are un-released docs, we don't want search engines indexing them.
},
}
: {}),
// Configuration example:
// "0.11.1": {
// path: "0.11.1", // default, but can be anything.
// label: "0.11.1", // default, but can be anything.
// banner: "unmaintained"
// // and more!
// },
},
// ------------------------------------------------------ //
},
blog: {
showReadingTime: true,
blogSidebarCount: 'ALL',
blogSidebarTitle: 'All our posts',
postsPerPage: 'ALL',
editUrl: 'https://github.com/wasp-lang/wasp/edit/release/web',
},
theme: {
customCss: [require.resolve('./src/css/custom.css')],
},
},
],
],
scripts: getScripts(),
plugins: [
'plugin-image-zoom',
async function myPlugin(context, options) {
return {
name: 'docusaurus-tailwindcss',
configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push(require('tailwindcss'))
postcssOptions.plugins.push(require('autoprefixer'))
return postcssOptions
},
}
},
// This plugin is always inactive in development and only active in
// production because it works on the build output.
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
{
from: '/docs/guides/auth-ui',
to: '/docs/auth/ui',
},
{
from: '/docs/deploying',
to: '/docs/deployment/intro',
},
{
from: '/docs/advanced/deployment/overview',
to: '/docs/deployment/intro',
},
{
from: '/docs/guides/username-password',
to: '/docs/auth/username-and-pass',
},
{
from: '/docs/guides/websockets',
to: '/docs/advanced/web-sockets',
},
{
from: '/docs/guides/testing',
to: '/docs/project/testing',
},
{
from: '/docs/guides/middleware-customization',
to: '/docs/advanced/middleware-config',
},
{
from: '/docs/guides/email-auth',
to: '/docs/auth/email',
},
{
from: '/docs/guides/crud',
to: '/docs/data-model/crud',
},
{
from: '/docs/integrations/google',
to: '/docs/auth/social-auth/google',
},
{
from: '/docs/integrations/github',
to: '/docs/auth/social-auth/github',
},
{
from: '/docs/integrations/css-frameworks',
to: '/docs/project/css-frameworks',
},
{
from: '/docs/tutorials/todo-app',
to: '/docs/tutorial/create',
},
{
from: '/docs/migrate-from-0-11-to-0-12',
to: '/docs/migration-guides/migrate-from-0-11-to-0-12',
},
{
from: '/docs/migrate-from-0-12-to-0-13',
to: '/docs/migration-guides/migrate-from-0-12-to-0-13',
},
{
from: '/docs/migrate-from-0-13-to-0-14',
to: '/docs/migration-guides/migrate-from-0-13-to-0-14',
},
],
},
],
],
}
function getScripts() {
const scripts = [
'/scripts/posthog.js',
'/js/fix-multiple-trailing-slashes.js',
]
if (isProduction) {
// Using Cloudflare Workers to proxy the analytics script
scripts.push({
src: '/waspara/wasp/script.js',
defer: true,
'data-domain': 'wasp.sh',
'data-api': '/waspara/wasp/event',
})
}
return scripts
}