Skip to content

Commit

Permalink
fix: now repo page OG images are corrext for production (#3179)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickytonline committed Apr 16, 2024
1 parent 3507168 commit 772c7b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pages/s/[org]/[repo]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
const { owner } = await response.json();

const range = (context.query.range ? Number(context.query.range) : 30) as Range;
const { NEXT_PUBLIC_BASE_URL = "http://localhost:3000" } = process.env;
const { href: ogImageUrl } = new URL(getRepositoryOgImage(repoData, range), NEXT_PUBLIC_BASE_URL);
const { href: ogImageUrl } = new URL(
getRepositoryOgImage(repoData, range),
process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000"
);

return { props: { repoData, image: owner?.avatar_url || "", ogImageUrl } };
}
Expand Down

0 comments on commit 772c7b5

Please sign in to comment.