---
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) => {
  return new Date(b.data.date).valueOf() - new Date(a.data.date).valueOf()
});
---

<ContentLayout 
  title="Blog | Timothy Pidashev"
  description="My experiences and technical insights into software development and the ever-evolving world of programming."
>
  <BlogPostList posts={posts} client:load />
</ContentLayout>
