import { getSortedPostsData, PostMeta } from "../lib/posts"; import Link from "next/link"; import Window from "../components/window"; function isNew(dateStr: string): boolean { const postDate = new Date(dateStr); const now = new Date(); const diffDays = (now.getTime() - postDate.getTime()) / (1000 * 60 * 60 * 24); return diffDays <= 30; } export default function Home() { const allPostsData: PostMeta[] = getSortedPostsData(); return (

Gabriel's Kaszewski Blog

A little corner of the internet from the 2000s.

{allPostsData.length > 0 ? (
    {allPostsData.map(({ id, date, title, wip }) => (
  • {isNew(date) && !wip && (
    NEW!
    )} {wip && (
    🚧 WIP
    )}

    {title}

    {new Date(date).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", })}
  • ))}
) : (

No posts found. Add some markdown files to the 'posts' directory!

)}
); }