This commit is contained in:
parent
b2accdd1a3
commit
9739575f50
1 changed files with 5 additions and 3 deletions
|
@ -16,6 +16,8 @@ const posts = await getCollection('posts')
|
|||
import { timeZone } from "../lib/utils";
|
||||
import HR from '../components/HR.astro';
|
||||
|
||||
let okay = 0;
|
||||
|
||||
---
|
||||
|
||||
<BaseLayout title="home">
|
||||
|
@ -32,14 +34,14 @@ import HR from '../components/HR.astro';
|
|||
<p class="mb-2">Expect posts once or twice a week, I guess.</p>
|
||||
|
||||
<p class="mb-2"><b>Last journal update:</b>
|
||||
<a href="/journal" class="font-serif text-subtitle text-sm hover:underline">June 14, 2025</a>
|
||||
<a href="/journal" class="font-serif text-subtitle text-sm hover:underline">June 23, 2025</a>
|
||||
</p>
|
||||
|
||||
<h2 class="font-serif text-2xl mb-2">recent posts</h2>
|
||||
<ul class="space-y-2 mb-2">
|
||||
{posts.sort((a, b) => compareDesc(new Date(a.data.date), new Date(b.data.date))).map((post, idx) => {
|
||||
if (idx >= 3 || post.data.draft) return;
|
||||
console.log(toZonedTime(post.data.date, timeZone));
|
||||
if (okay >= 3 || post.data.draft) return;
|
||||
okay++;
|
||||
return (
|
||||
<li >
|
||||
<a href={'/posts/' + post.slug} class="font-serif text-lg text-crusta-400 dark:text-night-300 hover:underline">{post.data.title}</a>
|
||||
|
|
Loading…
Add table
Reference in a new issue