wasp/web/docusaurus.config.js

286 lines
9.0 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')
/** @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: {
2022-12-20 18:03:25 +03:00
/*
announcementBar: {
2022-11-27 15:59:40 +03:00
id: 'Beta_is_here',
2022-12-08 20:43:25 +03:00
content: 'Wasp Hackathon #1 is underway! 🚀 <a href="https://betathon.wasp-lang.dev/">Join now</a>',
2022-11-29 18:32:08 +03:00
backgroundColor: '#eab307',
2022-11-27 15:59:40 +03:00
textColor: '#fff',
isCloseable: false,
},
2022-12-20 18:03:25 +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.
includeCurrentVersion: process.env.NODE_ENV === 'development',
// 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:
process.env.NODE_ENV === 'development' ? 'current' : undefined,
// Uncomment line below to build and show only current docs, for faster build times
// during development, if/when needed.
// onlyIncludeVersions: process.env.NODE_ENV === 'development' ? ["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.
...(process.env.NODE_ENV === 'development'
? {
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
},
[
'@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
},
],
},
],
2022-10-24 11:43:21 +03:00
],
2023-11-02 23:46:07 +03:00
}