blob: 0acaaeeb24104eba70b2f1f652e330fbdde615b3 (
plain) (
blame)
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
41
42
43
44
45
46
47
48
49
|
---
import Page from "../../layouts/Page.astro";
import { getCollection } from "astro:content";
import {formatDate} from "../../util";
import "../../styles/cards.css";
import {Icon} from "astro-icon/components";
const allBlogPosts = (await getCollection('blog')).sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
---
<Page title="Blog" description="Where I post can be anything!">
<main>
<div class="header">
<a href="/blog/rss.xml">
<Icon name="fa6-solid:square-rss" class="icon" />
</a>
</div>
<div class="grid">
{allBlogPosts.map((post) => (
<article class="card">
<h1><a href={`/blog/${post.slug}`}>{post.data.title}</a></h1>
<small>{formatDate(post.data.pubDate)}</small>
<p>{post.data.description}</p>
<div class="tags">
{post.data.tags.map((tag) => (
<a href={`/blog/tags/${tag}`}>{tag}</a>
))}
</div>
</article>
))
}
</div>
</main>
</Page>
<style>
.tags {
display: flex;
flex-direction: row;
gap: 1em;
}
.header {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 0.5em;
font-size: 3em;
}
</style>
|