1
0
Fork 0
freesewing/sites/dev/docusaurus.config.mjs

191 lines
5.1 KiB
JavaScript

import path from 'node:path'
import { themes as prismThemes } from 'prism-react-renderer'
const config = {
title: 'FreeSewing',
tagline: 'An open source Javascript library for parametric sewing patterns',
favicon: 'img/favicon.ico',
url: 'https://freesewing.dev',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
/*
* We need to make sure we can import from .mjs files
*/
plugins: [
() => ({
name: 'mjs-loader',
configureWebpack() {
return {
module: {
rules: [
{
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
},
{
test: /\.mjs$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: ['@babel/preset-react'],
},
},
},
],
},
}
},
}),
() => ({
name: 'fs-loader',
configureWebpack() {
const fsConfig = {
resolve: { alias: {} },
}
// Load plugins from source, rather than compiled package
for (const plugin of [
'core-plugins',
'plugin-annotations',
'plugin-bin-pack',
'plugin-bust',
'plugin-flip',
'plugin-gore',
'plugin-i18n',
'plugin-measurements',
'plugin-mirror',
'plugin-ringsector',
'plugin-round',
'plugin-sprinkle',
'plugin-svgattr',
'plugin-theme',
'plugin-timing',
'plugin-versionfree-svg',
]) {
fsConfig.resolve.alias[`@freesewing/${plugin}`] = path.resolve(
__dirname,
`../../plugins/${plugin}/src/index.mjs`
)
}
// Load these from source, rather than compiled package
for (const pkg of ['core', 'i18n', 'models', 'snapseries']) {
fsConfig.resolve.alias[`@freesewing/${pkg}`] = path.resolve(
__dirname,
`../../packages/${pkg}/src/index.mjs`
)
}
return fsConfig
},
}),
],
i18n: { defaultLocale: 'en', locales: ['en'] },
presets: [
[
'classic',
{
docs: {
routeBasePath: '/',
sidebarPath: './sidebars.js',
editUrl: 'https://codeberg.com/freesewing/freesewing/tree/develop/sites/dev/',
},
theme: {
customCss: './src/css/custom.css',
},
},
],
],
themeConfig: {
colorMode: {
// Do not be tempted to change these
disableSwitch: true,
respectPrefersColorScheme: true,
},
algolia: {
appId: 'VBV9JOCO5C',
apiKey: '663aefa13d332c45801dc32d9d5ea718',
indexName: 'freesewing',
},
image: 'img/freesewing-social-card.png',
navbar: {
title: 'FreeSewing.dev',
logo: {
alt: 'FreeSewing Logo',
src: 'img/logo-white.svg',
},
items: [
{ to: '/guides', label: 'Guides', position: 'left' },
{ to: '/howtos', label: 'Howtos', position: 'left' },
{ to: '/reference', label: 'Reference', position: 'left' },
{ to: '/tutorials', label: 'Tutorials', position: 'left' },
{
href: 'https://freesewing.org/',
label: 'FreeSewing.org',
position: 'right',
},
],
},
footer: {
style: 'light',
links: [
{
title: 'Docs',
items: [
{ label: 'Guides', to: '/guides' },
{ label: 'Howtos', to: '/howtos' },
{ label: 'Reference', to: '/reference' },
{ label: 'Tutorials', to: '/tutorials' },
],
},
{
title: 'Help & Support',
items: [
{
label: 'Forum',
href: 'https://forum.freesewing.eu/',
},
{
label: 'Discord',
href: 'https://discord.freesewing.org/',
},
{
label: 'All Support Options',
href: 'https://freesewing.eu/support',
},
],
},
{
title: 'More',
items: [
{
label: 'FreeSewing.eu',
to: 'https://freesewing.eu/',
},
{
label: 'FreeSewing.social',
to: 'https://freesewing.social/',
},
{
label: 'Code on Codeberg',
href: 'https://codeberg.org/freesewing/freesewing',
},
],
},
],
copyright: `<a href="https://freesewing.org/">FreeSewing</a> is brought to you by <a href="https://codeberg.eu/joostdecock">Joost De Cock</a> and <a href="https://codeberg.eu/freesewing/freesewing/blob/develop/CONTRIBUTORS.md">contributors</a> with the financial support of <a href="https://freesewing.org/patrons/join">our patrons</a>`,
},
prism: {
theme: prismThemes.dracula,
darkTheme: prismThemes.dracula,
},
},
}
export default config