We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c3e7b40 commit e68b3b7Copy full SHA for e68b3b7
1 file changed
src/pages/index.astro
@@ -7,7 +7,7 @@ import { getCollection } from 'astro:content';
7
8
const posts = (await getCollection('blog'))
9
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf())
10
- .slice(0, 3);
+const postsSlice = posts.slice(0, 3);
11
12
const projects = (await getCollection('projects'))
13
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
@@ -42,8 +42,8 @@ const projectsSlice = projects.slice(0, 4);
42
</div>
43
44
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
45
- {posts.length > 0 ? (
46
- posts.map((post) => (
+ {postsSlice.length > 0 ? (
+ postsSlice.map((post) => (
47
<PostCard post={post} />
48
))
49
) : (
0 commit comments