From 2e8f5636382b0ae6ae2a6de66affcbeacbd33826 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 26 May 2026 04:26:54 +0000 Subject: [PATCH] Layout: resolve metadataBase against the deploy's actual origin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The hardcoded `new URL('https://aturi.to')` caused OG image URLs on every non-production deploy (testing.aturi.to, Vercel previews) to point back at production — so embeds of the staging site fetched the OG image from production's build, masking any OG redesigns until they shipped to prod. Switch to getSiteUrl() (already used elsewhere) so the metadataBase follows NEXT_PUBLIC_SITE_URL / VERCEL_URL / config.domain in that order. Production behavior is unchanged; staging now serves its own OG image. Note: embedders (Bluesky's CardyB, etc.) cache OG fetches for hours to days, so an already-shared link may keep showing the old image until the cache expires or the post is re-fetched. --- src/app/layout.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index fc65655..eaeb849 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -6,12 +6,17 @@ import Footer from "@/components/Footer"; import PageTransition from "@/components/PageTransition"; import ThemeSync from "@/components/ThemeSync"; import { DEFAULT_THEME, THEME_INIT_SCRIPT } from "@/lib/theme"; +import { getSiteUrl } from "@/lib/config"; import "./globals.css"; export const metadata: Metadata = { title: "aturi.to — Tour the Atmosphere", description: "Travel between clients with the browser extension, share universal Atmosphere links, and explore any account's PDS data.", - metadataBase: new URL('https://aturi.to'), + // Use the deploy's actual origin (testing.aturi.to on staging, a preview + // URL on Vercel previews) so OG image URLs resolve against THIS deploy + // and not production. Without this, embeds on staging would render + // whatever OG image production happened to have built. + metadataBase: new URL(getSiteUrl()), manifest: '/site.webmanifest', openGraph: { title: "aturi.to — Tour the Atmosphere", -- 2.51.2