personal-website/astro.config.mjs
Cyril Šebek cd27a8e508
Update Astro & created custom middleware
- Updated Astro to newest version (4.11.0)
- Created custom middleware (middleware.js), to extend on Astro's default i18n
- Code cleanup and bugfixes
2024-06-20 14:20:27 +02:00

55 lines
1.1 KiB
JavaScript

import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";
import mdx from "@astrojs/mdx";
import sitemap from "@astrojs/sitemap";
import node from "@astrojs/node";
import rehypePrettyCode from "rehype-pretty-code";
import rehypeSlug from "rehype-slug";
import react from "@astrojs/react";
// https://astro.build/config
export default defineConfig({
output: "server",
adapter: node({
mode: "standalone",
}),
site: "https://cyrilsebek.cz",
integrations: [
tailwind({
applyBaseStyles: false,
}),
mdx({
syntaxHighlight: false,
rehypePlugins: [rehypeSlug, [rehypePrettyCode, { theme: "github-dark" }]],
}),
sitemap(),
react(),
],
i18n: {
locales: [
{
path: "cs",
codes: ["cs", "sk"],
},
{
path: "de",
codes: ["de", "gsw"],
},
{
path: "en",
codes: ["en"],
},
{
path: "fr",
codes: ["fr"],
},
],
defaultLocale: "en",
routing: "manual",
fallback: {
de: "en",
fr: "en",
},
},
});