64 lines
1.9 KiB
JavaScript
64 lines
1.9 KiB
JavaScript
import { defineConfig } from 'astro/config';
|
|
import starlight from '@astrojs/starlight';
|
|
import { unified } from '@astrojs/markdown-remark';
|
|
import { sidebar } from './src/config/sidebar.mjs';
|
|
import { legacyBachelorRedirects } from './src/config/legacy-bachelor-redirects.mjs';
|
|
import { baseAwareLinks } from './src/config/base-aware-markdown.mjs';
|
|
|
|
const site = process.env.SITE || 'http://localhost:4321';
|
|
const base = process.env.BASE || '/';
|
|
const normalizedBase = base === '/'
|
|
? ''
|
|
: `/${base.replace(/^\/+|\/+$/g, '')}`;
|
|
const matomoConsentScript = `${normalizedBase}/matomo-consent.js`;
|
|
|
|
export default defineConfig({
|
|
site,
|
|
base,
|
|
redirects: Object.fromEntries(Object.entries(legacyBachelorRedirects).map(([from, to]) => [from, `${normalizedBase}${to}`])),
|
|
markdown: {
|
|
processor: unified({ remarkPlugins: [[baseAwareLinks, { base }]] }),
|
|
},
|
|
integrations: [
|
|
starlight({
|
|
title: 'Incognito Wiki',
|
|
description: 'Academic knowledge and student resources maintained by MSV Incognito.',
|
|
lastUpdated: true,
|
|
sidebar,
|
|
logo: {
|
|
light: './src/assets/logo-dark.png',
|
|
dark: './src/assets/logo.svg',
|
|
alt: 'MSV Incognito',
|
|
replacesTitle: true,
|
|
},
|
|
favicon: '/favicon.ico',
|
|
customCss: ['./src/styles/incognito.css'],
|
|
routeMiddleware: ['./src/starlight-route-data.ts'],
|
|
components: {
|
|
Sidebar: './src/components/Sidebar.astro',
|
|
},
|
|
markdown: {
|
|
processedDirs: ['./src/content/shared-courses/'],
|
|
},
|
|
head: [
|
|
{
|
|
tag: 'script',
|
|
attrs: {
|
|
src: matomoConsentScript,
|
|
defer: true,
|
|
},
|
|
},
|
|
],
|
|
social: [
|
|
{
|
|
icon: 'external',
|
|
label: 'MSV Incognito website',
|
|
href: 'https://msvincognito.nl/',
|
|
},
|
|
],
|
|
editLink: {
|
|
baseUrl: 'https://git.msvincognito.nl/Incognito-Tech/Incognito-Wiki/_edit/main/',
|
|
},
|
|
}),
|
|
],
|
|
});
|