From 0db2e6643dd8678283eb3b1ab3ab499bfe62a0fc Mon Sep 17 00:00:00 2001 From: Lucas Smith Date: Thu, 14 Mar 2024 10:39:48 +0000 Subject: [PATCH] fix: final final v2 --- .../src/app/(marketing)/blog/[post]/page.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/apps/marketing/src/app/(marketing)/blog/[post]/page.tsx b/apps/marketing/src/app/(marketing)/blog/[post]/page.tsx index d8ef587c4..b0d59edc1 100644 --- a/apps/marketing/src/app/(marketing)/blog/[post]/page.tsx +++ b/apps/marketing/src/app/(marketing)/blog/[post]/page.tsx @@ -28,11 +28,11 @@ export const generateMetadata = ({ params }: { params: { post: string } }) => { }); // Use the url constructor to ensure that things are escaped as they should be - const openGraphImageUrl = new URL(`${blogPost.href}/opengraph`); - - openGraphImageUrl.searchParams.set('title', blogPost.title); - openGraphImageUrl.searchParams.set('author', blogPost.authorName); - openGraphImageUrl.searchParams.set('sig', signature); + const searchParams = new URLSearchParams({ + title: blogPost.title, + author: blogPost.authorName, + sig: signature, + }); return { title: { @@ -40,10 +40,10 @@ export const generateMetadata = ({ params }: { params: { post: string } }) => { }, description: blogPost.description, openGraph: { - images: [openGraphImageUrl.toString()], + images: [`${blogPost.href}/opengraph?${searchParams.toString()}`], }, twitter: { - images: [openGraphImageUrl.toString()], + images: [`${blogPost.href}/opengraph?${searchParams.toString()}`], }, }; };