This commit is contained in:
commit
8372d5e659
15 files changed
+5976
No files matched your search
@@ -0,0 +1,35 @@
|
||||
---
|
||||
import BaseLayout from '../layouts/BaseLayout.astro';
|
||||
import { getCollection } from 'astro:content';
|
||||
|
||||
const posts = (await getCollection('posts', ({ data }) => !data.draft))
|
||||
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
|
||||
---
|
||||
|
||||
<BaseLayout title="hoelee.dev — personal blog">
|
||||
<h1>hoelee.dev</h1>
|
||||
<p>
|
||||
I'm Hoelee — a full-stack developer and DevOps engineer. I build web apps,
|
||||
self-host infrastructure, and automate things. Here I write about what I
|
||||
learn and ship.
|
||||
</p>
|
||||
|
||||
<h2>Latest posts</h2>
|
||||
{posts.length === 0 ? (
|
||||
<p><em>No posts yet — check back soon.</em></p>
|
||||
) : (
|
||||
<ul class="post-list">
|
||||
{posts.slice(0, 10).map((post) => (
|
||||
<li>
|
||||
<a href={`/posts/${post.slug}/`}>
|
||||
<h2>{post.data.title}</h2>
|
||||
</a>
|
||||
<time datetime={post.data.pubDate.toISOString()}>
|
||||
{post.data.pubDate.toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' })}
|
||||
</time>
|
||||
<p>{post.data.description}</p>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
</BaseLayout>
|
||||
Reference in new issue
Block a user