Localized pathname function for links. inlang/paraglide-astro package Signed-off-by: Martin Berg Alstad <git@martials.no>
36 lines
874 B
JavaScript
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
|
|
})
|
|
]
|
|
}) |