36 lines
868 B
Plaintext
36 lines
868 B
Plaintext
---
|
|
import PostItem from "@/components/post-item";
|
|
import Layout from "@/layouts/Layout.astro";
|
|
import { sortContentByDate } from "@/utils/sorts";
|
|
import { getCollection } from "astro:content";
|
|
|
|
const pageData = {
|
|
title: "Blog",
|
|
description: "Long format about thoughts and other topics.",
|
|
};
|
|
|
|
const allPosts = await getCollection("blog", ({ data }) => data.draft !== true);
|
|
sortContentByDate(allPosts);
|
|
---
|
|
|
|
<Layout {...pageData}>
|
|
<section class="prose prose-invert">
|
|
<h1>{pageData.title}</h1>
|
|
<p>{pageData.description}</p>
|
|
</section>
|
|
<ul class="mt-4 flex flex-col gap-4">
|
|
{
|
|
allPosts.map((blogpost: any) => (
|
|
<li>
|
|
<PostItem
|
|
type="blog"
|
|
slug={blogpost.slug}
|
|
date={blogpost.data.date!}
|
|
title={blogpost.data.title!}
|
|
/>
|
|
</li>
|
|
))
|
|
}
|
|
</ul>
|
|
</Layout>
|