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

export async function getStaticPaths() {
  const blogEntries = await getCollection("blog");
  return blogEntries.map((entry) => ({
    params: { slug: entry.slug },
    props: { entry },
  }));
}

const { entry } = Astro.props;
const { Content, headings } = await entry.render();
---

<ArticleLayout id={entry.id} {...entry.data} {headings}>
  <Content />
</ArticleLayout>
