import { Link } from "react-router-dom"; import CardLink from "../components/CardLink"; interface PostMeta { slug: string; title: string; date: string; excerpt: string; cover?: string; } const postFiles = import.meta.glob("../blog/*.md", { eager: true }) as Record< string, { attributes: Omit } >; const posts: PostMeta[] = Object.entries(postFiles) .map(([path, mod]) => ({ slug: path.split("/").pop()!.replace(".md", ""), ...(mod.attributes as Omit), })) .sort( (a, b) => new Date(b.date).getTime() - new Date(a.date).getTime() ); export default function Blog() { return (

Blog

{posts.map((post) => ( ))}
); }