---
import { getCollection } from "astro:content";
import Base from "@layouts/Base.astro";
import Summary from "@components/Summary.astro";
const posts = await getCollection("blog");  
posts.sort((a, b) => new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime());
---

<Base>
  {
    posts.map((post) => (
      <Summary
        url={`/posts/${post.slug}`}
        description={post.data.description}
        date={post.data.pubDate}
        title={post.data.title}
        tags={post.data.tags}
      />
    ))
  }
</Base>
