martials.no/astro.config.mjs
Martin Berg Alstad c701a510f7
Button group to switch languages.
Localized pathname function for links.

inlang/paraglide-astro package

Signed-off-by: Martin Berg Alstad <git@martials.no>
2024-10-09 21:30:05 +02:00

36 lines
874 B
JavaScript

// @ts-check
import { defineConfig } from "astro/config"
import tailwind from "@astrojs/tailwind"
import sitemap from "@astrojs/sitemap"
import paraglide from "@inlang/paraglide-astro"
import { loadEnv } from "vite"
import mdx from "@astrojs/mdx"
import svelte from "@astrojs/svelte"
import icon from "astro-icon"
const { url } = process.env.URL
? loadEnv(process.env.URL, process.cwd(), "")
: { url: "http://localhost:3000" }
// https://astro.build/config
export default defineConfig({
site: url,
// output: "server", TODO server | also required for i18n
i18n: {
defaultLocale: "nb",
locales: ["nb", "en"]
},
integrations: [
tailwind(),
sitemap(),
mdx(),
svelte(),
icon(),
paraglide({
// recommended settings
project: "./project.inlang",
outdir: "./src/paraglide" //where your files should be
})
]
})