This commit is contained in:
Blboun3
2024-05-26 13:29:06 +02:00
parent a8ec23e1e8
commit 0c2600a7f6
9 changed files with 73 additions and 50 deletions

View File

@@ -1,7 +1,18 @@
---
import { getLocaleByPath } from "astro:i18n";
import type { GetStaticPaths } from "astro";
import MainLayout from "../layouts/MainLayout.astro";
export const getStaticPaths = (() => {
return [
{params: {lang: "en"}},
{params: {lang: "cs"}},
{params: {lang: "de"}},
{params: {lang: "fr"}}
];
}) satisfies GetStaticPaths;
const { lang } = Astro.params
// Don't remove - redirects user to language version for the preffered language
if (Astro.preferredLocale) {
return Astro.redirect(`/${Astro.preferredLocale}/`);
@@ -9,7 +20,7 @@ if (Astro.preferredLocale) {
---
<MainLayout title="sitetitle" description="sitedescription" lang="en">
<MainLayout title="sitetitle" description="sitedescription" lang={lang}>
<h1>Welcome</h1>
<p>
You shouldn't be here. please continue to one of the following: