From a64e3ce6ef743ded68c899302ef1919f9663b15d Mon Sep 17 00:00:00 2001 From: antoniotrkdz Date: Wed, 6 May 2026 12:29:40 +0200 Subject: [PATCH 1/2] =?UTF-8?q?fix(bug):=20=F0=9F=90=9B=20#783,=20og:image?= =?UTF-8?q?=20now=20have=20a=20valid=20base64=20and=20twitter:image=20prop?= =?UTF-8?q?erty=20now=20have=20absolute=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/project/[id]/index.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pages/project/[id]/index.tsx b/pages/project/[id]/index.tsx index 77dc107f..9292116c 100644 --- a/pages/project/[id]/index.tsx +++ b/pages/project/[id]/index.tsx @@ -47,6 +47,13 @@ const Project: NextPageWithLayout = () => { const { project } = useProject(); const images = useMemo(() => findProjectImages(project), [project]); + // OG/Twitter crawlers require absolute HTTP URLs — base64 data URIs don't work, + // and the /api/image proxy path needs an origin prefix. + const ogImages = useMemo(() => { + const origin = typeof window !== "undefined" ? window.location.origin : ""; + return images.filter(url => !url.startsWith("data:")).map(url => (url.startsWith("/") ? `${origin}${url}` : url)); + }, [images]); + // (Temp) Redirect if project is LOSH owned if (process.env.NEXT_PUBLIC_LOSH_ID == project?.primaryAccountable?.id) { router.push(`/resource/${id}`); @@ -64,12 +71,11 @@ const Project: NextPageWithLayout = () => { url: window.location.origin + router.asPath, title: project?.name, description: project?.note || undefined, - images: images?.map((image, i) => ({ + images: ogImages.map((image, i) => ({ url: image, width: 800, height: 600, alt: `${project?.name}${i > 0 ? " " + i : ""}`, - type: project?.images?.[i]?.mimeType || "image/jpeg", })), siteName: "Interfacer-gui", }} From eaf50216e4ebe73361dfa2acfa644f9320fe769f Mon Sep 17 00:00:00 2001 From: antoniotrkdz Date: Thu, 7 May 2026 15:34:16 +0200 Subject: [PATCH 2/2] =?UTF-8?q?fix(bug):=20=F0=9F=90=9B=20#783,=20og:image?= =?UTF-8?q?=20now=20have=20a=20valid=20base64=20or=20an=20absolute=20path,?= =?UTF-8?q?=20it=20appears=20twitter:image=20property=20cannot=20be=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/project/[id]/index.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/project/[id]/index.tsx b/pages/project/[id]/index.tsx index 9292116c..4a1c8ee3 100644 --- a/pages/project/[id]/index.tsx +++ b/pages/project/[id]/index.tsx @@ -51,7 +51,12 @@ const Project: NextPageWithLayout = () => { // and the /api/image proxy path needs an origin prefix. const ogImages = useMemo(() => { const origin = typeof window !== "undefined" ? window.location.origin : ""; - return images.filter(url => !url.startsWith("data:")).map(url => (url.startsWith("/") ? `${origin}${url}` : url)); + return images.map((url, i) => ({ + url: url.startsWith("/") ? `${origin}${url}` : url, + width: 800, + height: 600, + alt: `${project?.name}${i > 0 ? " " + i : ""}`, + })); }, [images]); // (Temp) Redirect if project is LOSH owned @@ -71,12 +76,7 @@ const Project: NextPageWithLayout = () => { url: window.location.origin + router.asPath, title: project?.name, description: project?.note || undefined, - images: ogImages.map((image, i) => ({ - url: image, - width: 800, - height: 600, - alt: `${project?.name}${i > 0 ? " " + i : ""}`, - })), + images: ogImages, siteName: "Interfacer-gui", }} twitter={{