Bluewaterblog/blog/src/pages/index.astro
2026-08-29 10:45:37 +02:00

20 lines
545 B
Text

---
import Main from "../layouts/Main.astro";
import PostPreviewLarge from "../components/PostPreviewLarge.astro";
import PostGrid from "../components/PostGrid.astro";
import { getCollection } from "astro:content";
const allPostsSorted = (await getCollection('posts')).sort(
(postA, postB) =>
postB.data.date.getTime() - postA.data.date.getTime()
);
const [mostRecentPost, ...sortedPosts] = allPostsSorted;
---
<Main title="Startseite">
<PostPreviewLarge
post={mostRecentPost.data}
/>
<PostGrid posts={sortedPosts} />
</Main>