From 706f83743724e36d337095703bfe66098c44027d Mon Sep 17 00:00:00 2001 From: marshmallow Date: Sun, 5 May 2024 12:15:36 +1000 Subject: [PATCH] refactor: per-lang index page --- src/components/{ => home}/Goals.astro | 2 +- src/components/{ => home}/Hero.astro | 4 ++-- src/components/home/Home.astro | 16 +++++++++++++++ src/components/{ => home}/Roadmap.astro | 2 +- src/components/{ => home}/Values.astro | 2 +- src/layouts/Layout.astro | 3 +++ src/pages/en/index.astro | 8 ++++++++ src/pages/index.astro | 26 +------------------------ 8 files changed, 33 insertions(+), 30 deletions(-) rename src/components/{ => home}/Goals.astro (92%) rename src/components/{ => home}/Hero.astro (91%) create mode 100644 src/components/home/Home.astro rename src/components/{ => home}/Roadmap.astro (94%) rename src/components/{ => home}/Values.astro (92%) create mode 100644 src/pages/en/index.astro diff --git a/src/components/Goals.astro b/src/components/home/Goals.astro similarity index 92% rename from src/components/Goals.astro rename to src/components/home/Goals.astro index 4a33762..9a22f5a 100644 --- a/src/components/Goals.astro +++ b/src/components/home/Goals.astro @@ -1,5 +1,5 @@ --- -import { getLangFromUrl, useTranslations } from '../i18n/utils'; +import { getLangFromUrl, useTranslations } from '../../i18n/utils'; const lang = getLangFromUrl(Astro.url); const translation = useTranslations(lang); diff --git a/src/components/Hero.astro b/src/components/home/Hero.astro similarity index 91% rename from src/components/Hero.astro rename to src/components/home/Hero.astro index 3f512dd..f715f2e 100644 --- a/src/components/Hero.astro +++ b/src/components/home/Hero.astro @@ -1,7 +1,7 @@ --- -import { getLangFromUrl, useTranslations } from '../i18n/utils'; +import { getLangFromUrl, useTranslations } from '../../i18n/utils'; import { Image } from 'astro:assets'; -import aux from '../../public/aux.svg'; +import aux from '../../../public/aux.svg'; const lang = getLangFromUrl(Astro.url); const translation = useTranslations(lang); diff --git a/src/components/home/Home.astro b/src/components/home/Home.astro new file mode 100644 index 0000000..9acde27 --- /dev/null +++ b/src/components/home/Home.astro @@ -0,0 +1,16 @@ +--- +import Hero from "./Hero.astro"; +import Values from "./Values.astro"; +import Goals from "./Goals.astro"; +import Roadmap from "./Roadmap.astro"; +--- + +
+ + +
+ + + +
+
diff --git a/src/components/Roadmap.astro b/src/components/home/Roadmap.astro similarity index 94% rename from src/components/Roadmap.astro rename to src/components/home/Roadmap.astro index 7e7eb4e..a526b4d 100644 --- a/src/components/Roadmap.astro +++ b/src/components/home/Roadmap.astro @@ -1,5 +1,5 @@ --- -import { getLangFromUrl, useTranslations } from '../i18n/utils'; +import { getLangFromUrl, useTranslations } from '../../i18n/utils'; const lang = getLangFromUrl(Astro.url); const translation = useTranslations(lang); diff --git a/src/components/Values.astro b/src/components/home/Values.astro similarity index 92% rename from src/components/Values.astro rename to src/components/home/Values.astro index 09d5464..9bbb1a2 100644 --- a/src/components/Values.astro +++ b/src/components/home/Values.astro @@ -1,5 +1,5 @@ --- -import { getLangFromUrl, useTranslations } from '../i18n/utils'; +import { getLangFromUrl, useTranslations } from '../../i18n/utils'; const lang = getLangFromUrl(Astro.url); const translation = useTranslations(lang); diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 8c297f4..bfeeabc 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -1,5 +1,6 @@ --- import { getLangFromUrl } from '../i18n/utils'; +import Header from "../components/Header.astro"; interface Props { title: string; @@ -22,6 +23,8 @@ const lang = getLangFromUrl(Astro.url); +
+ diff --git a/src/pages/en/index.astro b/src/pages/en/index.astro new file mode 100644 index 0000000..504d049 --- /dev/null +++ b/src/pages/en/index.astro @@ -0,0 +1,8 @@ +--- +import Layout from "../../layouts/Layout.astro"; +import Home from "../../components/home/Home.astro"; +--- + + + + diff --git a/src/pages/index.astro b/src/pages/index.astro index ac19f86..655eb6c 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,25 +1 @@ ---- -import Layout from "../layouts/Layout.astro"; -import Header from "../components/Header.astro"; -import Hero from "../components/Hero.astro"; -import Values from "../components/Values.astro"; -import Goals from "../components/Goals.astro"; -import Roadmap from "../components/Roadmap.astro"; ---- - - -
-
- -
- -
- - - -
-
-
-
- - +