blob: 84cca840ce8cb331a2a793c81a79fc9b1350a056 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
---
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,
}));
const repeatArray = (arr, times) => Array(times).fill(arr).flat();
const repeated = repeatArray(blogs, 10);
---
<Terminal path="blogs/">
<TerminalBorder
header="Shell"
extra="mb-[5vw] sm:mt-[0.625vw] sm:mb-[1.5625vw]"
>
<p>$ ls -lah -t --color=auto ~/blogs</p>
</TerminalBorder>
<div class="max-h-[80svh] sm:max-h-[24vw] overflow-y-auto">
{
repeated.map((blog) => (
<>
<BlogItem
title={blog.title}
description={blog.description ?? ""}
date={blog.date}
href={blog.href}
/>
</>
))
}
</div>
</Terminal>
|