feat(og-image): add social card images for projects, experience, and talks

This commit is contained in:
Prad Nukala
2026-06-30 13:05:14 -04:00
parent f701c951e4
commit 2178cef232
11 changed files with 173 additions and 55 deletions
+10 -2
View File
@@ -16,8 +16,16 @@ export function getFormattedDate(
}
export function collectionDateSort(
a: CollectionEntry<"writing" | "projects">,
b: CollectionEntry<"writing" | "projects">,
a: CollectionEntry<"writing" | "speaking">,
b: CollectionEntry<"writing" | "speaking">,
) {
return b.data.publishDate.getTime() - a.data.publishDate.getTime();
}
/** Sort projects by end date, most recent first; ongoing (no end date) first. */
export function projectDateSort(a: CollectionEntry<"projects">, b: CollectionEntry<"projects">) {
const ae = a.data.endDate?.getTime() ?? Number.POSITIVE_INFINITY;
const be = b.data.endDate?.getTime() ?? Number.POSITIVE_INFINITY;
if (be !== ae) return be - ae;
return b.data.startDate.getTime() - a.data.startDate.getTime();
}