---
import { getCollection } from "astro:content";

import BlogEntry from "../components/BlogEntry.astro";
import Partition from "../components/Partition.astro";
import BaseLayout from "../layouts/BaseLayout.astro";
const allPosts = await getCollection("blog");

const pageTitle = "Aria's blog";
---

<BaseLayout pageTitle={pageTitle}>
    <Partition>
        | <a href="/tags" class="nav-btn">Browse Tags</a> |<br />
        <h1 class="text-2xl">All blog posts:</h1>
    <ul>
        {
            allPosts.map((post: any) => (
                <BlogEntry
                    url={`/posts/${post.id}/`}
                    title={post.data.title}
                    date={post.data.pubDate.toLocaleDateString()}
                />
            ))
        }
    </ul>
</Partition>
</BaseLayout>
