Files
undefined.behavio.rs/src/pages/index.astro

22 lines
584 B
Plaintext

---
import { getCollection } from "astro:content";
import General from "@layouts/General.astro";
import Summary from "@components/Summary.astro";
const posts = (await getCollection("blog")).filter(entry => !entry.data.draft);
posts.sort((a, b) => new Date(b.data.pubDate).getTime() - new Date(a.data.pubDate).getTime());
---
<General>
{
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>