fix: final final v2
This commit is contained in:
@@ -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
|
// Use the url constructor to ensure that things are escaped as they should be
|
||||||
const openGraphImageUrl = new URL(`${blogPost.href}/opengraph`);
|
const searchParams = new URLSearchParams({
|
||||||
|
title: blogPost.title,
|
||||||
openGraphImageUrl.searchParams.set('title', blogPost.title);
|
author: blogPost.authorName,
|
||||||
openGraphImageUrl.searchParams.set('author', blogPost.authorName);
|
sig: signature,
|
||||||
openGraphImageUrl.searchParams.set('sig', signature);
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: {
|
title: {
|
||||||
@@ -40,10 +40,10 @@ export const generateMetadata = ({ params }: { params: { post: string } }) => {
|
|||||||
},
|
},
|
||||||
description: blogPost.description,
|
description: blogPost.description,
|
||||||
openGraph: {
|
openGraph: {
|
||||||
images: [openGraphImageUrl.toString()],
|
images: [`${blogPost.href}/opengraph?${searchParams.toString()}`],
|
||||||
},
|
},
|
||||||
twitter: {
|
twitter: {
|
||||||
images: [openGraphImageUrl.toString()],
|
images: [`${blogPost.href}/opengraph?${searchParams.toString()}`],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user