aboutsummaryrefslogtreecommitdiff
path: root/apps/website/src/pages/blog/index.astro
blob: 4bccad4d465b7004c851b55bfd21d42ab5e425be (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
---
/// <reference types="../../env.d.ts" />
import { getCollection } from 'astro:content';
import FormattedDate from '../../components/base/FormattedDate.astro';
import Layout from '../../layouts/Layout.astro';

const posts = (await getCollection('blog')).sort(
	(a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf(),
);
---

<Layout title="Polyfrost Blog" description="Recieve Polyfrost updates here">
	<section>
		<ul>
			{
				posts.map(post => (
					<li>
						<a href={`blog/${post.slug}/`}>
							<img width={720} height={360} src={post.data.heroImage} alt=""/>
							<h4 class="title">{post.data.title}</h4>
							<p class="date">
								<FormattedDate date={post.data.pubDate}/>
							</p>
						</a>
					</li>
				))
			}
		</ul>
	</section>
</Layout>