Skip to content

Commit 0104c7d

Browse files
committed
update author og img with bio in all the places
1 parent 9c9044a commit 0104c7d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/pages/authors/[author].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const { slug, author, posts } = Astro.props;
4545
const avatarUrl = author.avatar || (author.github ? `https://github.com/${author.github}.png` : "");
4646
---
4747

48-
<BaseLayout title={`${author.name} | Python Insider`} image={withBase(`/og/authors/${slug}.png`)}>
48+
<BaseLayout title={`${author.name} | Python Insider`} description={author.bio} image={withBase(`/og/authors/${slug}.png`)}>
4949
<div class="animate-fade-up">
5050
<a
5151
href={withBase("/authors")}

src/pages/og/authors/[author].png.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,19 @@ export const getStaticPaths: GetStaticPaths = async () => {
2525
params: { author: author.id },
2626
props: {
2727
name: author.data.name,
28+
bio: author.data.bio,
2829
postCount: authorCounts.get(author.id) || 0,
2930
},
3031
}));
3132
};
3233

3334
export const GET: APIRoute = async ({ props }) => {
34-
const { name, postCount } = props as { name: string; postCount: number };
35+
const { name, bio, postCount } = props as { name: string; bio?: string; postCount: number };
3536

3637
const fonts = await getFonts();
3738

3839
const svg = await satori(
39-
OgAuthorImage({ name, postCount }),
40+
OgAuthorImage({ name, bio, postCount }),
4041
{ width: 1200, height: 630, fonts },
4142
);
4243

0 commit comments

Comments
 (0)