---
import { getCollection } from "astro:content";
import ContentLayout from "@/layouts/content.astro";

import { BlogPostList } from "@/components/blog/post-list";

const posts = (await getCollection("blog", ({ data }) => {
  return data.isDraft !== true;
})).sort(
	(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
);
---

<ContentLayout content={{ title: "Blog | Timothy Pidashev" }}>
  <BlogPostList posts={posts} client:load />
</ContentLayout>
