diff --git a/workspaces/website/src/pages/posts/@category/@slug/index.page.server.tsx b/workspaces/website/src/pages/posts/@category/@slug/index.page.server.tsx index 62736901650..a3ec7fb961b 100644 --- a/workspaces/website/src/pages/posts/@category/@slug/index.page.server.tsx +++ b/workspaces/website/src/pages/posts/@category/@slug/index.page.server.tsx @@ -25,6 +25,11 @@ 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, @@ -32,7 +37,7 @@ export async function onBeforeRender(pageContext: PageContextServer) { documentProps: { title: post.title, description: post.short_desc, - image: `${import.meta.env.VITE_SITE_URL}${post.image}`, + image: `${baseUrl}${post.image}`, } satisfies DocumentProps, }, };