Files
cunicu/website/docusaurus.config.js
Steffen Vogel 2da5d48215 website: initial version
Signed-off-by: Steffen Vogel <post@steffenvogel.de>
2022-09-08 23:59:29 +02:00

182 lines
4.9 KiB
JavaScript

// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
const math = require('remark-math');
const katex = require('rehype-katex');
async function createConfig() {
const mdxMermaid = await import('mdx-mermaid')
/** @type {import('@docusaurus/types').Config} */
return {
title: 'cunīcu',
tagline: 'zeroconf • p2p • mesh • vpn',
url: 'https://cunicu.li',
baseUrl: '/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: 'img/favicon.ico',
trailingSlash: false,
stylesheets: [
{
href: 'https://cdn.jsdelivr.net/npm/katex@0.13.24/dist/katex.min.css',
type: 'text/css',
integrity:
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
crossorigin: 'anonymous',
},
],
plugins: [
[
require.resolve('@cmfcmf/docusaurus-search-local'),
{
}
],
[
require.resolve("@gabrielcsapo/docusaurus-plugin-matomo"),
{
siteId: "5",
matomoUrl: "https://matomo.0l.de",
siteUrl: "https://cunicu.li",
}
],
function (context, options) {
return {
name: 'webpack-configuration-plugin',
configureWebpack(config, isServer, utils) {
return {
resolve: {
symlinks: false,
}
};
}
};
},
],
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'stv0g', // Usually your GitHub org/user name.
projectName: 'cunicu', // Usually your repo name.
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/stv0g/cunicu/tree/master/website/',
remarkPlugins: [
mdxMermaid.default,
math
],
rehypePlugins: [
katex
],
},
blog: {
showReadingTime: true,
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/stv0g/cunicu/master/website',
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
title: 'cunīcu',
logo: {
alt: 'cunīcu logo',
src: 'img/cunicu_icon.svg',
},
items: [
{
type: 'doc',
docId: 'index',
position: 'left',
label: 'Docs',
},
{to: '/blog', label: 'Blog', position: 'left'},
{
href: 'https://github.com/stv0g/cunicu',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Docs',
items: [
{
label: 'Tutorial',
to: '/docs/',
},
],
},
{
title: 'Community',
items: [
{
label: 'Slack',
href: 'https://gophers.slack.com/archives/C036CTEGJFN',
},
{
label: 'Twitter',
href: 'https://twitter.com/cunicuVPN',
},
],
},
{
title: 'More',
items: [
{
label: 'Blog',
to: '/blog',
},
{
label: 'GitHub',
href: 'https://github.com/stv0g/cunicu',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Institute for Automation of Complex Power Systems, RWTH Aachen University.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};
}
module.exports = createConfig;