update page structure

This commit is contained in:
2025-02-06 19:12:41 -05:00
parent 27bf9ad185
commit e15bb944c9
22 changed files with 6236 additions and 88 deletions
+28
View File
@@ -0,0 +1,28 @@
---
import { getCollection } from 'astro:content';
import Layout from '@layouts/Layout.astro';
import PostPreview from '@components/PostPreview.astro';
const posts = await getCollection('blog');
---
<Layout title="Home">
{
posts
.sort(
(a, b) =>
new Date(b.data.pubDate).valueOf() -
new Date(a.data.pubDate).valueOf()
)
.slice(0, 10)
.map((post) => <PostPreview post={post} />)
}
{
posts.length < 6 ? null : (
<div class="more-posts">
<a href="blog/archive/all">All Posts</a>
</div>
)
}
</Layout>