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:
31
src/layouts/BlogPost.astro
Normal file
31
src/layouts/BlogPost.astro
Normal 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>
|
@ -1,7 +0,0 @@
|
||||
---
|
||||
const { frontmatter } = Astro.props;
|
||||
---
|
||||
|
||||
<h1>{frontmatter.title}</h1>
|
||||
<p>{frontmatter.autor}</p>
|
||||
<slot />
|
Reference in New Issue
Block a user