Prettier config

This commit is contained in:
2023-02-25 17:56:35 +00:00
parent eaa1ccfd9e
commit b60f598ba2
17 changed files with 1381 additions and 220 deletions
+23 -23
View File
@@ -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>