--- import { getCollection } from "astro:content"; import { formatDistanceToNow } from "date-fns"; const allFragments = await getCollection("fragment"); const allSets = await getCollection("fragmentSet"); type Fragment = (typeof allFragments)[0]; type FragmentProps = { f: Fragment; ix: number; }; const { f, ix } = Astro.props as FragmentProps; const date_published = f.data.date_published; ---

{f.data.title}

{f.data.preview}

{formatDistanceToNow(new Date(date_published), { addSuffix: true })}