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:
@@ -6,7 +6,7 @@ import { getAllPosts } from "@/data/post";
|
||||
import { getAllSpeaking } from "@/data/speaking";
|
||||
import PageLayout from "@/layouts/Base.astro";
|
||||
import { siteConfig, socialLinks } from "@/site.config";
|
||||
import { collectionDateSort } from "@/utils/date";
|
||||
import { collectionDateSort, projectDateSort } from "@/utils/date";
|
||||
|
||||
const MAX_POSTS = 4;
|
||||
const allPosts = await getAllPosts();
|
||||
@@ -17,9 +17,7 @@ const latestPosts = (allPosts.sort(collectionDateSort) as CollectionEntry<"writi
|
||||
|
||||
const MAX_PROJECTS = 2;
|
||||
const allProjects = await getCollection("projects");
|
||||
const latestProjects = allProjects
|
||||
.sort(collectionDateSort)
|
||||
.slice(0, MAX_PROJECTS) as CollectionEntry<"projects">[];
|
||||
const latestProjects = allProjects.sort(projectDateSort).slice(0, MAX_PROJECTS);
|
||||
|
||||
const MAX_TALKS = 3;
|
||||
const latestTalks = (await getAllSpeaking()).sort(collectionDateSort).slice(0, MAX_TALKS);
|
||||
|
||||
Reference in New Issue
Block a user