import { Link } from "vocs"; type Frontmatter = { title?: string; description?: string; date?: string }; const frontmatters = import.meta.glob( ["../pages/blog/*.mdx", "!../pages/blog/index.mdx"], { eager: true, import: "frontmatter" }, ); const posts = Object.entries(frontmatters) .map(([file, frontmatter]) => ({ ...frontmatter, href: `/blog/${file .split("/") .pop()! .replace(/\.mdx$/, "")}`, })) .sort((a, b) => Date.parse(b.date ?? "") - Date.parse(a.date ?? "")); export function BlogPosts() { return (
{posts.map((post, index) => (
{index > 0 && (
)}

{post.title}

{post.date}

{post.description} [→]

))}
); }