---
import { getCollection } from "astro:content";
import Posts from "@layouts/Posts.astro";
import getSortedPosts from "@utils/getSortedPosts";
import getPagination from "@utils/getPagination";

const posts = await getCollection("blog");

const sortedPosts = getSortedPosts(posts);

const pagination = getPagination({
  posts: sortedPosts,
  page: 1,
  isIndex: true,
});
---

<Posts {...pagination} />
