fix(seo): set metadataBase so og:image resolves to the live domain#135
Merged
Conversation
After the OG image shipped, production served og:image = http://localhost:3000/opengraph-image — Next resolves relative metadata image URLs against metadataBase, and without one it falls back to localhost. LinkedIn, WhatsApp and Slack cannot fetch that, so the card stayed imageless. Sets metadataBase from NEXT_PUBLIC_BASE_URL, which docker-compose.prod.yml already bakes as https://testforge.emha.space at Docker build time. Verified against a local production build with NEXT_PUBLIC_BASE_URL set: og:image and twitter:image now both point at https://testforge.emha.space. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #133 — the OG image shipped, but production was still advertising it on a URL no scraper can reach.
After #133 deployed,
https://testforge.emha.space/served:Next resolves relative metadata image URLs against
metadataBase; with none set it falls back tohttp://localhost:3000. LinkedIn, WhatsApp and Slack can't fetch that, so the card would still have rendered without an image — the exact thing #133 was meant to fix.Fix —
metadataBasein the root layout, taken fromNEXT_PUBLIC_BASE_URL, whichdocker-compose.prod.ymlalready bakes ashttps://testforge.emha.spaceat Docker build time (build.args). Falls back tohttp://localhost:3000for local dev. No compose change needed.Verified — local production build with
NEXT_PUBLIC_BASE_URL=https://testforge.emha.space, thennpm start:🤖 Generated with Claude Code