import Link from "next/link"; import { allOtherPages } from "contentlayer/generated" import { YOUTUBE_ID_REGEX } from "lib/constants"; export async function getStaticProps() { const posts = allOtherPages .filter((page) => page._raw.sourceFileDir === "notes") .map((page) => { return { title: page.title || null, description: page.description || null, date: page.date, image: page.image || null, youtube: page.youtube || null, link: `/${page._raw.flattenedPath}`, }; }) .sort((a, b) => new Date(b.date) - new Date(a.date)); return { props: { posts } }; } export default function Notes({ posts }) { return (

Our latest articles and explorations.

{posts && posts.map(({ title, description, image, youtube, link }) => ( title && description && (
{image && {title}}
) ))}
); }