Create i18n blog posts

Content stored in /src/content/blog/[slug]/<lang>.md
TODO: fix missing content in language
TODO: main blog page
This commit is contained in:
2024-05-29 08:05:39 +02:00
parent fdc43aa699
commit 18eb59ff2a
8 changed files with 155 additions and 29 deletions

View File

@ -0,0 +1,31 @@
---
import type { CollectionEntry } from "astro:content";
import FormattedDate from "../components/FormattedDate.astro";
import SinglePage from "./SinglePage.astro";
import MainLayout from "./MainLayout.astro";
type Props = CollectionEntry<"blog">["data"];
const { title, description, publishDate, language } =
Astro.props;
---
<MainLayout
title={title}
description={description}
publishDate={publishDate}
lang={language}
>
<article>
<div class="prose">
<div class="title">
<div class="date">
<FormattedDate date={publishDate} />
</div>
<h1>{title}</h1>
<hr />
</div>
<slot />
</div>
</article>
</MainLayout>

View File

@ -1,7 +0,0 @@
---
const { frontmatter } = Astro.props;
---
<h1>{frontmatter.title}</h1>
<p>{frontmatter.autor}</p>
<slot />