mirror of
https://github.com/Kyren223/website.git
synced 2026-04-27 23:03:55 +00:00
36 lines
1.1 KiB
Plaintext
36 lines
1.1 KiB
Plaintext
---
|
|
import Terminal from "@layouts/Terminal.astro";
|
|
import TerminalBorder from "@components/TerminalBorder.astro";
|
|
import BlogItem from "@components/BlogItem.astro";
|
|
import { getCollection } from "astro:content";
|
|
|
|
const blogs = (await getCollection("blogs"))
|
|
.sort((a, b) => +new Date(b.data.date) - +new Date(a.data.date))
|
|
.map((blog) => ({
|
|
title: blog.data.title,
|
|
description: blog.data.description,
|
|
date: blog.data.date,
|
|
href: "/blogs/" + blog.slug,
|
|
}));
|
|
---
|
|
|
|
<Terminal path="blogs/">
|
|
<TerminalBorder header="Shell" margin="0.5rem 0 20px">
|
|
<p>$ ls -lah -t --color=auto ~/blogs</p>
|
|
</TerminalBorder>
|
|
<div class="max-h-[18.5rem] overflow-y-auto">
|
|
{
|
|
blogs.map((blog) => (
|
|
<>
|
|
<BlogItem
|
|
title={blog.title}
|
|
description={blog.description ? blog.description : ""}
|
|
date={blog.date}
|
|
href={blog.href}
|
|
/>
|
|
</>
|
|
))
|
|
}
|
|
</div>
|
|
</Terminal>
|