From 288573a36fab7a1f1aa75de61d907023d048eca2 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Thu, 9 Apr 2026 20:50:15 +0200 Subject: [PATCH] Replace `WEB_URL` with `DEPLOYED_WEB_URL` for dynamic environment support in Open Graph utilities and SEO components. --- common/src/util/og.ts | 4 ++-- web/components/SEO.tsx | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/common/src/util/og.ts b/common/src/util/og.ts index 48a8a052..21bed5ae 100644 --- a/common/src/util/og.ts +++ b/common/src/util/og.ts @@ -1,9 +1,9 @@ -import {WEB_URL} from 'common/envs/constants' +import {DEPLOYED_WEB_URL} from 'common/envs/constants' // opengraph functions that run in static props or client-side, but not in the edge (in image creation) export function buildOgUrl

>(props: P, endpoint: string) { const generateUrlParams = (params: P) => new URLSearchParams(params).toString() - return `${WEB_URL}/api/og/${endpoint}?` + generateUrlParams(props) + return `${DEPLOYED_WEB_URL}/api/og/${endpoint}?` + generateUrlParams(props) } diff --git a/web/components/SEO.tsx b/web/components/SEO.tsx index 66ad6f47..35d53a86 100644 --- a/web/components/SEO.tsx +++ b/web/components/SEO.tsx @@ -1,4 +1,4 @@ -import {endTitle} from 'common/envs/constants' +import {DEPLOYED_WEB_URL, endTitle} from 'common/envs/constants' import {removeUndefinedProps} from 'common/util/object' import {buildOgUrl} from 'common/util/og' import Head from 'next/head' @@ -15,20 +15,21 @@ export function SEO

>(props: { const imageUrl = image ?? (ogProps && buildOgUrl(removeUndefinedProps(ogProps.props) as any, ogProps.endpoint)) - const absUrl = 'https://compassmeet.com' + url + const absUrl = DEPLOYED_WEB_URL + url return ( {`${title} | ${endTitle}`} - + {/*OG tags (WhatsApp, Facebook, etc.)*/} + + + + {/*Twitter/X tags — separate!*/} + + + - {url && }