feat: add og image to blog posts

This commit is contained in:
Ephraim Atta-Duncan
2023-08-30 02:50:02 +00:00
committed by Mythie
parent 991411c9f5
commit d536305c1c
2 changed files with 9 additions and 2 deletions

View File

@ -17,7 +17,12 @@ export const generateMetadata = ({ params }: { params: { post: string } }) => {
notFound();
}
return { title: `Documenso - ${blogPost.title}` };
return {
title: `Documenso - ${blogPost.title}`,
openGraph: {
images: [`/api/blog-og?title=${blogPost.title}`],
},
};
};
const mdxComponents: MDXComponents = {

View File

@ -145,7 +145,9 @@ export default async function handler(req: NextRequest) {
/>
</svg>
<h1 tw="text-6xl mt-4 w-3/5 font-bold text-center">{title}</h1>
<h1 tw="text-6xl flex justify-center items-center mt-8 -mb-6 w-3/5 font-bold text-center mx-auto">
{title}
</h1>
</div>
),
{