mirror of
https://github.com/prdlk/website.git
synced 2026-08-02 17:31:41 +00:00
feat(og-image): add social card images for projects, experience, and talks
This commit is contained in:
+10
-2
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user