Repository navigation
refactor: clean root metadata - remove generator, add metadataBase, OG and twitter defaults - #1059
Merged
greatest0fallt1me merged 2 commits intoNov 23, 2026
Conversation
…G and twitter defaults
|
@ruthoreaji-123 is attempting to deploy a commit to the Jagadeesh B's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@Ade-Pheebs Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Thanks @Ade-Pheebs! We resolved the merge conflicts on our side and merged this. 🎉 |
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.
refactor: clean root metadata — remove generator, add metadataBase, OG and twitter defaults
Summary
Root metadata in
app/layout.tsxhadgenerator: "v0.dev", nometadataBase, noopenGraph, and notwitterdefaults. Relative OG image URLs would resolve incorrectly withoutmetadataBase. This PR cleans it up usinglib/config.tsandlib/seo.ts.Background
export const metadatawas an untyped object withgenerator: "v0.dev".lib/config.tsexportsconfig.app.urlandconfig.app.name.lib/seo.tsexportsgetBaseUrl()which readsNEXT_PUBLIC_APP_URLdynamically.app/markets/[id]/page.tsxandapp/api/og/route.tsxneed an absolute base for OG images.Changes
app/metadata.ts(new file)metadataobject into its own module so it can be unit-tested without importinglayout.tsx(which pulls innext/font/googleand CSS files)Metadatafromnextgenerator: "v0.dev"metadataBase: new URL(getBaseUrl())— followsNEXT_PUBLIC_APP_URLtitleas an object withdefaultandtemplate: "%s | Predictify"openGraph:type: "website",siteNamefromconfig.app.name,url,title,description,imagestwitter:card: "summary_large_image",title,description,imagesiconsunchangedapp/layout.tsxmetadatafromapp/metadata.tsviewportexport asViewportfromnextapp/__tests__/layout-metadata.test.ts(new file)app/metadata.tsdirectly (avoids Next.js font/CSS transform issues in Jest)generatorfieldmetadataBasematches default URL whenNEXT_PUBLIC_APP_URLis unsetmetadataBasefollowsNEXT_PUBLIC_APP_URLwhen setmetadataBasehandles trailing slash inNEXT_PUBLIC_APP_URL%s | Predictifyand has a defaultopenGraphexists withtype: "website",siteName,title,description,imagestwitterexists withcard: "summary_large_image",title,descriptioniconspreservedAcceptance Criteria
generatormetametadataBasefollowsNEXT_PUBLIC_APP_URLopenGraphandtwitterdefaults existiconsandviewportexport unchangedTesting
pnpm test -- app/__tests__/layout-metadata.test.tsCloses #1015
Upstream repo: https://github.com/Predictify-org/predictify-frontend