Idk, tryin' to make i18n compatible. Doesn't rly work.

This commit is contained in:
2024-03-24 21:19:56 +01:00
parent ec72e14237
commit 0a6ccd4339
20 changed files with 693 additions and 157 deletions

0
src/pages/404.astro Normal file
View File

View File

@@ -0,0 +1,19 @@
---
import { getLocaleByPath } from "astro:i18n";
import MainLayout from "../../layouts/MainLayout.astro";
export async function getStaticPaths() {
return ["en", "fr", "cs", "de"].map((lang) => {
return { params: { lang } };
});
}
---
<MainLayout title="sitetitle" description="sitedescription" lang={Astro.currentLocale}>
<h1>Welcome</h1>
<p>
"homeP1"
{Astro.url.toString()}
{getLocaleByPath(Astro.currentLocale)}
</p>
</MainLayout>

View File

@@ -1,4 +0,0 @@
---
---
<a href="/posts/post-1">Post 01</a>

View File

@@ -1,5 +1,13 @@
---
import Layout from "../layouts/Layout.astro"
import { getLocaleByPath } from "astro:i18n";
import MainLayout from "../layouts/MainLayout.astro";
---
<Layout title='Welcome!' lang='en'>
</Layout>
<MainLayout title="sitetitle" description="sitedescription" lang="en">
<h1>Welcome</h1>
<p>
"homeP1"
{Astro.url.toString()}
{getLocaleByPath("en")}
</p>
</MainLayout>

View File

@@ -1,27 +0,0 @@
---
title: 'My First Blog Post'
pubDate: 2022-07-01
description: 'This is the first post of my new Astro blog.'
author: 'Astro Learner'
image:
url: 'https://docs.astro.build/assets/full-logo-light.png'
alt: 'The full Astro logo.'
tags: ["astro", "blogging", "learning in public"]
---
# My First Blog Post
Published on: 2022-07-01
Welcome to my _new blog_ about learning Astro! Here, I will share my learning journey as I build a new website.
## What I've accomplished
1. **Installing Astro**: First, I created a new Astro project and set up my online accounts.
2. **Making Pages**: I then learned how to make pages by creating new `.astro` files and placing them in the `src/pages/` folder.
3. **Making Blog Posts**: This is my first blog post! I now have Astro pages and Markdown posts!
## What's next
I will finish the Astro tutorial, and then keep adding more posts. Watch this space for more to come.