Skip to content

Commit

Permalink
refactor: per-lang index page
Browse files Browse the repository at this point in the history
  • Loading branch information
mrshmllow committed May 5, 2024
1 parent 6e218b3 commit 706f837
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/components/Hero.astro → src/components/home/Hero.astro
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
16 changes: 16 additions & 0 deletions src/components/home/Home.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
import Hero from "./Hero.astro";
import Values from "./Values.astro";
import Goals from "./Goals.astro";
import Roadmap from "./Roadmap.astro";
---

<main class="grid place-items-center">
<Hero />

<div class="prose prose-invert py-16 px-4 max-w-3xl">
<Values />
<Goals />
<Roadmap />
</div>
</main>
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import { getLangFromUrl } from '../i18n/utils';
import Header from "../components/Header.astro";
interface Props {
title: string;
Expand All @@ -22,6 +23,8 @@ const lang = getLangFromUrl(Astro.url);
<meta name="verify" content="https://github.com/jakehamilton" />
</head>
<body>
<Header />

<slot />
</body>
</html>
Expand Down
8 changes: 8 additions & 0 deletions src/pages/en/index.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
import Layout from "../../layouts/Layout.astro";
import Home from "../../components/home/Home.astro";
---

<Layout title="aux.computer">
<Home />
</Layout>
26 changes: 1 addition & 25 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -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";
---

<Layout title="aux.computer">
<main>
<Header />

<div class="grid place-items-center">
<Hero />
<div class="prose prose-invert py-16 px-4 max-w-3xl">
<Values />
<Goals />
<Roadmap />
</div>
</div>
</main>
</Layout>

<style></style>
<meta http-equiv="refresh" content="0;url=/en/" />

0 comments on commit 706f837

Please sign in to comment.