Skip to content

Commit

Permalink
Update Article Thumb (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemans authored Apr 16, 2024
1 parent a0f7a93 commit 38cd71f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions blog/app/post/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,20 @@ const page = async ({ params }: PageProperties) => {
const { default: PostContent, readingTime } = (await import(
`../../../../content/${post.file}/readme.mdx`
)) as {
default: (properties: MDXProps) => JSX.Element;
default: (_properties: MDXProps) => JSX.Element;
readingTime: string;
};

const postImageData = await covers[post.file as keyof typeof covers]?.[
'cover-thumb'
];
const postImage = postImageData?.default?.src;

const schema: WithContext<Article> = {
'@context': 'https://schema.org',
'@type': 'Article',
headline: post.title,
image: post.cover,
image: postImage,
datePublished: new Date(post.date).toISOString(),
author: post.authors?.map((author) => ({
'@type': 'Person',
Expand Down

0 comments on commit 38cd71f

Please sign in to comment.