Bluewaterblog/blog/src/pages/index.astro
2026-09-10 12:04:04 +02:00

20 lines
No EOL
544 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>