Skip to content

Commit

Permalink
Fix twitter share image
Browse files Browse the repository at this point in the history
  • Loading branch information
nuno-aac committed Sep 21, 2023
1 parent 4755cf9 commit 1b7ea2a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,19 @@ export async function onBeforeRender(pageContext: PageContextServer) {
},
};

const baseUrl = import.meta.env.VITE_GIT_BRANCH_NAME === "production"
? "https://www.starknet.io"
: import.meta.env.VITE_SITE_URL ?? "http://localhost:3000";


return {
pageContext: {
...defaultPageContext,
pageProps,
documentProps: {
title: post.title,
description: post.short_desc,
image: `${import.meta.env.VITE_SITE_URL}${post.image}`,
image: `${baseUrl}${post.image}`,
} satisfies DocumentProps,
},
};
Expand Down

0 comments on commit 1b7ea2a

Please sign in to comment.