From 74239421182e83667657a273c661b9238d7bf605 Mon Sep 17 00:00:00 2001 From: git-chad Date: Fri, 16 Oct 2026 12:43:24 -0300 Subject: [PATCH] Serve the X card image from a route like the community scene cards X's crawler fetches the editor page and its tags but never shows the static public JPEG, while the route-rendered community scene images unfurl. Render the editor card through the same ImageResponse path, which also puts X's image fetch in the request logs. --- biome.json | 2 +- src/app/tools/shader-lab/x-card/route.tsx | 23 +++++++++++++++++++++++ src/lib/app.ts | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 src/app/tools/shader-lab/x-card/route.tsx diff --git a/biome.json b/biome.json index fc4d0b6b..d732ca29 100644 --- a/biome.json +++ b/biome.json @@ -159,7 +159,7 @@ } }, { - "includes": ["**/opengraph-image.tsx", "**/twitter-image.tsx"], + "includes": ["**/opengraph-image.tsx", "**/twitter-image.tsx", "**/x-card/route.tsx"], "linter": { "rules": { "performance": { diff --git a/src/app/tools/shader-lab/x-card/route.tsx b/src/app/tools/shader-lab/x-card/route.tsx new file mode 100644 index 00000000..4e7387ad --- /dev/null +++ b/src/app/tools/shader-lab/x-card/route.tsx @@ -0,0 +1,23 @@ +import { ImageResponse } from "next/og" + +const size = { height: 630, width: 1200 } + +export async function GET(request: Request) { + const src = new URL("/opengraph-image.jpg?v=2", request.url).toString() + + return new ImageResponse( +
+ +
, + { + ...size, + headers: { "Cache-Control": "public, max-age=0, must-revalidate" }, + } + ) +} diff --git a/src/lib/app.ts b/src/lib/app.ts index 01946ac7..a71b4dcc 100644 --- a/src/lib/app.ts +++ b/src/lib/app.ts @@ -42,7 +42,7 @@ export const APP_TWITTER_IMAGES = [ { alt: APP_DEFAULT_TITLE, height: 630, - url: "/opengraph-image.jpg?v=2", + url: "/tools/shader-lab/x-card", width: 1200, }, ]