sync
This commit is contained in:
@@ -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:
|
||||
|
Reference in New Issue
Block a user