Prettier config
This commit is contained in:
+23
-23
@@ -1,33 +1,33 @@
|
||||
---
|
||||
export const prerender = true;
|
||||
import { getCollection } from "astro:content";
|
||||
export const prerender = true
|
||||
import { getCollection } from 'astro:content'
|
||||
|
||||
import Layout from "@layouts/Layout.astro";
|
||||
import PostPreview from "@components/PostPreview.astro";
|
||||
import Layout from '@layouts/Layout.astro'
|
||||
import PostPreview from '@components/PostPreview.astro'
|
||||
|
||||
const posts = await getCollection("blog");
|
||||
const posts = await getCollection('blog')
|
||||
---
|
||||
|
||||
<Layout title="Home">
|
||||
{
|
||||
posts
|
||||
.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate))
|
||||
.slice(0, 5)
|
||||
.map((post) => <PostPreview post={post} />)
|
||||
}
|
||||
{
|
||||
posts.length < 5 ? null : (
|
||||
<div class="more-posts">
|
||||
<a class="link-button blue-btn" href="/archive">
|
||||
All Posts
|
||||
</a>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
{
|
||||
posts
|
||||
.sort((a, b) => Date.parse(b.data.pubDate) - Date.parse(a.data.pubDate))
|
||||
.slice(0, 5)
|
||||
.map((post) => <PostPreview post={post} />)
|
||||
}
|
||||
{
|
||||
posts.length < 5 ? null : (
|
||||
<div class="more-posts">
|
||||
<a class="link-button blue-btn" href="/archive">
|
||||
All Posts
|
||||
</a>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
</Layout>
|
||||
|
||||
<style>
|
||||
.more-posts {
|
||||
text-align: center;
|
||||
}
|
||||
.more-posts {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user