SSR and i18n

Signed-off-by: Martin Berg Alstad <git@martials.no>
This commit is contained in:
2024-10-12 18:29:44 +02:00
parent 1a2fec6a59
commit 740cba625d
20 changed files with 273 additions and 62 deletions

View File

@ -1,14 +1,15 @@
// @ts-check
import { defineConfig } from "astro/config"
import paraglide from "@inlang/paraglide-astro"
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 node from "@astrojs/node"
import mdx from "@astrojs/mdx"
import icon from "astro-icon"
import { defineConfig } from "astro/config"
import { loadEnv } from "vite"
const { url } = process.env.URL
? loadEnv(process.env.URL, process.cwd(), "")
: { url: "http://localhost:3000" }
@ -16,7 +17,7 @@ const { url } = process.env.URL
// https://astro.build/config
export default defineConfig({
site: url,
// output: "server", TODO server | also required for i18n
output: "server",
i18n: {
defaultLocale: "nb",
locales: ["nb", "en"]
@ -32,5 +33,8 @@ export default defineConfig({
project: "./project.inlang",
outdir: "./src/paraglide" //where your files should be
})
]
],
adapter: node({
mode: "standalone"
})
})