feat: add dynamic Open Graph image for homepage#87
feat: add dynamic Open Graph image for homepage#87saurabhsingh72487-hub wants to merge 2 commits into
Conversation
|
@saurabhsingh72487-hub pls edit ur pr description according to the template and instead i see u did thru code instead of a image Generall workflow please read #19 and the CONTRIBUTING.md For now edit the pr description with the template from the repo But before raising a pull request u hav to get assigned to an issue pls join the discord if u have any doubts |
|
i can give u a top label if u implement this if u create a image using gemini nano banana for the open graph image pls join the discord so i can explain u clearly |
|
@saurabhsingh72487-hub star the repo |
There was a problem hiding this comment.
Pull request overview
Adds a dynamic Open Graph image for the homepage using Next.js metadata image generation, and updates site metadata to resolve OG URLs correctly.
Changes:
- Added
src/app/opengraph-image.tsxto generate the OG image at runtime vianext/ogImageResponse. - Added
metadataBaseand introduced homepageopenGraphmetadata insrc/app/layout.tsx. - Updated Twitter card metadata to use a large-image card layout (but currently references a non-existent image path—see comments).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/app/opengraph-image.tsx |
Introduces runtime OG image generation for the root route segment. |
src/app/layout.tsx |
Updates global metadata (base URL, Open Graph, Twitter) to integrate OG image behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| description: "Your open-source identity, beyond GitHub.", | ||
| type: "website", | ||
| images: ["/logo.png"], | ||
| images: ["/og-image.png"], |
| openGraph: { | ||
| title: "OSSfolio — Your Open Source Identity", | ||
| description: "Your open-source identity, beyond GitHub.", | ||
| type: "website", | ||
| }, |
| <img | ||
| src="https://ossfolio.qzz.io/logo.png" | ||
| width={180} | ||
| height={180} | ||
| /> | ||
|
|
|
@saurabhsingh72487-hub pls do the changes as i said in the comments Pls ask doubts in the discord if u dont know the workflow in opensource Thanks |
Problem
The OSSfolio homepage did not have an
og:imageconfigured, causing shared links on platforms such as Twitter, LinkedIn, WhatsApp, and Discord to appear without a preview image.Solution
Implemented a dynamic Open Graph image using Next.js
ImageResponseand integrated it with the site's metadata.Changes
src/app/opengraph-image.tsxto generate the Open Graph image dynamically.metadataBasefor proper absolute URL resolution.Implementation Notes
The issue recommended a static image approach (
public/og-image.png), but this PR uses the Next.js native Open Graph image generation approach (opengraph-image.tsx).This provides:
Testing
Related Issue
Closes #19