diff --git a/astro.config.mjs b/astro.config.mjs index 76c6fcd..341deaa 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -46,7 +46,7 @@ export default defineConfig({ ], defaultLocale: "en", routing: { - redirectToDefaultLocale: true, + redirectToDefaultLocale: false, prefixDefaultLocale: true }, fallback: { diff --git a/src/components/Showcase.astro b/src/components/Showcase.astro index 4237751..4802611 100644 --- a/src/components/Showcase.astro +++ b/src/components/Showcase.astro @@ -5,7 +5,7 @@ export const prerender = true; --- -
+
diff --git a/src/layouts/MainLayout.astro b/src/layouts/MainLayout.astro index ba78ba4..3f70eb0 100644 --- a/src/layouts/MainLayout.astro +++ b/src/layouts/MainLayout.astro @@ -4,13 +4,12 @@ import { ViewTransitions } from 'astro:transitions'; import Navbar from "../components/Navbar.astro"; import "../style/index.css"; import { useTranslations } from '../i18n/utils'; -//import "../style/globals.css"; const t = useTranslations(lang) --- - + @@ -26,9 +25,9 @@ const t = useTranslations(lang) - -
+ +
- + \ No newline at end of file diff --git a/src/layouts/SinglePage.astro b/src/layouts/SinglePage.astro index 523e433..911bd0a 100644 --- a/src/layouts/SinglePage.astro +++ b/src/layouts/SinglePage.astro @@ -1,4 +1,4 @@ -
+
+
-
+
diff --git a/src/pages/index.astro b/src/pages/index.astro index 22a65d0..d247817 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,36 +1,32 @@ --- -export const prerender = true; +export const prerender = true -import type { GetStaticPaths } from "astro"; import MainLayout from "../layouts/MainLayout.astro"; +import Hero from "../components/Hero.astro"; +import About from "../components/About.astro"; +import Showcase from "../components/Showcase.astro"; +import FloatingLinks from "../components/FloatingLinks.astro"; -export const getStaticPaths = (() => { - return [ - {params: {lang: "en"}}, - {params: {lang: "cs"}}, - {params: {lang: "de"}}, - {params: {lang: "fr"}} - ]; -}) satisfies GetStaticPaths; +//@ts-ignore +import { getLangFromUrl, useTranslations } from "../i18n/utils"; -const { lang } = Astro.params +const t = useTranslations(getLangFromUrl(Astro.url)); -// Don't remove -if (Astro.preferredLocale) { - return Astro.redirect(`/${Astro.preferredLocale}/`); +export async function getStaticPaths() { + return ["en", "fr", "cs", "de"].map((lang) => { + return { params: { lang } }; + }); } - --- - - -

Welcome

-

- You shouldn't be here. please continue to one of the following: -

- + + + + + + + + + \ No newline at end of file