wasp/web/docusaurus.config.js

302 lines
9.5 KiB
JavaScript
Raw Normal View History

2023-11-02 23:46:07 +03:00
const lightCodeTheme = require('prism-react-renderer/themes/github')
2023-11-02 23:46:07 +03:00
const autoImportTabs = require('./src/remark/auto-import-tabs')
const fileExtSwitcher = require('./src/remark/file-ext-switcher')
2024-07-03 14:39:14 +03:00
const includeCurrentVersion = process.env.DOCS_INCLUDE_CURRENT_VERSION === 'true'
/** @type {import('@docusaurus/types').DocusaurusConfig} */
module.exports = {
2023-11-02 23:46:07 +03:00
title: 'Wasp',
2023-04-12 13:18:12 +03:00
tagline:
2023-11-02 23:46:07 +03:00
'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 .
2023-11-02 23:46:07 +03:00
url: 'https://wasp-lang.dev',
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,
2023-11-02 23:46:07 +03:00
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
2022-10-24 11:43:21 +03:00
stylesheets: [
2023-11-02 23:46:07 +03:00
'https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap',
2022-10-24 11:43:21 +03:00
],
themeConfig: {
2024-07-16 21:31:58 +03:00
announcementBar: {
2024-07-16 21:31:58 +03:00
id: 'LW6',
content: '<b>Launch Week #6</b>: July 17 - 22 🐝 <a href="/blog/2024/07/15/wasp-launch-week-six">See what\'s new</a>',
2022-11-29 18:32:08 +03:00
backgroundColor: '#eab307',
2022-11-27 15:59:40 +03:00
textColor: '#fff',
isCloseable: false,
},
2024-07-16 21:31:58 +03:00
2023-01-31 14:09:08 +03:00
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',
*/
2023-04-12 13:18:12 +03:00
},
2023-01-31 14:09:08 +03:00
},
navbar: {
2023-11-02 23:46:07 +03:00
title: '.wasp (beta)',
logo: {
2023-11-02 23:46:07 +03:00
alt: 'Wasp logo',
src: 'img/wasp-logo-eqpar-circle.png',
href: 'https://wasp-lang.dev/',
target: '_self',
},
items: [
{
type: 'docsVersion',
2023-11-02 23:46:07 +03:00
position: 'left',
label: 'Docs',
2023-11-02 23:46:07 +03:00
className: 'navbar-item-docs navbar-item-outside',
},
{
type: 'docsVersionDropdown',
position: 'left',
2024-01-12 20:28:23 +03:00
className: 'navbar-item-docs-version-dropdown',
},
{
2023-11-02 23:46:07 +03:00
to: 'blog',
label: 'Blog',
position: 'left',
},
{
2023-11-02 23:46:07 +03:00
href: 'https://github.com/wasp-lang/wasp',
className: 'navbar-item-github',
position: 'right',
},
{
2023-11-02 23:46:07 +03:00
href: 'https://twitter.com/WaspLang',
className: 'navbar-item-twitter',
position: 'right',
},
{
2023-11-02 23:46:07 +03:00
href: 'https://discord.gg/rzdnErX',
className: 'navbar-item-discord',
position: 'right',
},
],
},
prism: {
2023-11-02 23:46:07 +03:00
additionalLanguages: ['shell-session', 'haskell'],
theme: lightCodeTheme,
},
footer: {
2023-11-02 23:46:07 +03:00
style: 'dark',
links: [
{
2023-11-02 23:46:07 +03:00
title: 'Docs',
items: [
{
2023-11-02 23:46:07 +03:00
label: 'Getting started',
to: 'docs',
},
{
2023-11-02 23:46:07 +03:00
label: 'Todo app tutorial',
to: 'docs/tutorial/create',
},
2023-04-12 13:18:12 +03:00
],
},
{
2023-11-02 23:46:07 +03:00
title: 'Community',
items: [
{
2023-11-02 23:46:07 +03:00
label: 'Discord',
href: 'https://discord.gg/rzdnErX',
2023-04-12 13:18:12 +03:00
},
],
},
{
2023-11-02 23:46:07 +03:00
title: 'More',
items: [
{
2023-11-02 23:46:07 +03:00
label: 'GitHub',
href: 'https://github.com/wasp-lang/wasp',
},
{
2023-11-02 23:46:07 +03:00
label: 'Contact',
to: 'docs/contact',
2023-04-12 13:18:12 +03:00
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Wasp.`,
},
algolia: {
2023-11-02 23:46:07 +03:00
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,
2023-04-12 13:18:12 +03:00
},
2023-11-02 23:46:07 +03:00
image: 'img/wasp_twitter_cover.png',
metadata: [{ name: 'twitter:card', content: 'summary_large_image' }],
},
presets: [
[
2023-11-02 23:46:07 +03:00
'@docusaurus/preset-classic',
{
2022-06-29 17:31:28 +03:00
gtag: {
2023-11-02 23:46:07 +03:00
trackingID: 'GTM-PQ4JFCK',
2022-06-29 17:31:28 +03:00
anonymizeIP: true,
},
docs: {
2023-11-02 23:46:07 +03:00
sidebarPath: require.resolve('./sidebars.js'),
2021-10-04 12:43:23 +03:00
sidebarCollapsible: true,
2023-11-02 23:46:07 +03:00
editUrl: 'https://github.com/wasp-lang/wasp/edit/release/web',
remarkPlugins: [autoImportTabs, fileExtSwitcher],
// ------ Configuration for multiple docs versions ------ //
// "current" docs (under /docs) are in-progress docs, so we show them only in development.
2024-07-03 14:39:14 +03:00
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:
2024-07-03 14:39:14 +03:00
includeCurrentVersion ? 'current' : undefined,
// Uncomment line below to build and show only current docs, for faster build times
// during development, if/when needed.
2024-07-03 14:39:14 +03:00
// 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.
2024-07-03 14:39:14 +03:00
...(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,
2023-11-02 23:46:07 +03:00
blogSidebarCount: 'ALL',
blogSidebarTitle: 'All our posts',
postsPerPage: 'ALL',
editUrl: 'https://github.com/wasp-lang/wasp/edit/release/web',
},
theme: {
2023-11-02 23:46:07 +03:00
customCss: [require.resolve('./src/css/custom.css')],
},
},
],
],
2023-11-02 23:46:07 +03:00
scripts: ['/scripts/posthog.js', '/js/fix-multiple-trailing-slashes.js'],
2022-10-24 11:43:21 +03:00
plugins: [
2023-11-02 23:46:07 +03:00
'plugin-image-zoom',
2022-10-24 11:43:21 +03:00
async function myPlugin(context, options) {
return {
2023-11-02 23:46:07 +03:00
name: 'docusaurus-tailwindcss',
2022-10-24 11:43:21 +03:00
configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer.
2023-11-02 23:46:07 +03:00
postcssOptions.plugins.push(require('tailwindcss'))
postcssOptions.plugins.push(require('autoprefixer'))
return postcssOptions
2022-10-24 11:43:21 +03:00
},
2023-11-02 23:46:07 +03:00
}
2022-10-24 11:43:21 +03:00
},
2024-10-04 13:36:06 +03:00
// 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/advanced/deployment/overview',
},
{
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',
2023-11-02 23:46:07 +03:00
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',
2023-08-31 10:32:20 +03:00
},
{
from: '/docs/tutorials/todo-app',
to: '/docs/tutorial/create',
2023-08-31 10:32:20 +03:00
},
2024-10-04 13:36:06 +03:00
{
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'
}
],
},
],
2022-10-24 11:43:21 +03:00
],
2023-11-02 23:46:07 +03:00
}