Skip to content

Use each profile's own GitHub avatar as its Open Graph image - #629

Merged
jbampton merged 2 commits into
NextCommunity:mainfrom
silverhand-ai:fix-profile-og-image-499
Oct 3, 2026
Merged

jbampton merged 2 commits into
NextCommunity:mainfrom
silverhand-ai:fix-profile-og-image-499

Conversation

@silverhand-ai

@silverhand-ai silverhand-ai commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

The site declares twitter:card: summary_large_image (in seo-meta.njk), which needs a substantially larger image to render correctly (1200x630 recommended, ~300x157 minimum). But every profile page was falling back to the same generic site.defaultImage, which is only 200x200 — too small for the large-image card type, and identical across every single profile regardless of who it is.

Verified live on the deployed site (opengraph.xyz preview + direct fetch): homepage/games page OG tags already render correctly with the site logo; profile pages (/users/{name}/) were the ones using the undersized, non-person-specific image.

Fix

Profile pages already have the person's github username in template scope. This uses their real GitHub avatar (https://github.com/{github}.png?size=460, confirmed live: 460x460, always reachable, no auth needed) as og:image/twitter:image instead of the shared generic logo — falling back to site.defaultImage only if a profile has no github field set. Homepage and all other non-profile pages are untouched.

Verification

  • Ran a full npm run build locally.
  • Confirmed _site/index.html (homepage) still uses site.defaultImage — unaffected.
  • Confirmed _site/users/0xMRTT/index.html now renders og:image as https://github.com/0xMRTT.png?size=460 — the person's real avatar, live and reachable (confirmed 200, 460x460 PNG).
  • Change is scoped to one line in one template file (src/_includes/layouts/base.njk); no other files touched.

🤖 Generated with Claude Code

Every user profile page currently shares the same generic 200x200
site logo (site.defaultImage) as its og:image/twitter:image, even
though the site declares twitter:card: summary_large_image, which
needs a substantially larger image to render correctly. Profile
pages already have the person's github username in scope, so this
uses their real GitHub avatar (460x460, always reachable) instead,
falling back to the site default only when no github username is
set. Homepage and other non-profile pages are unaffected.

Verified with a full `npm run build`: homepage still uses
site.defaultImage, every profile page now renders its own avatar
URL in og:image/twitter:image.
@deepsource-io

deepsource-io Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 3221bab...d9c6afc on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Oct 3, 2026 3:24a.m. Review ↗
Secrets Oct 3, 2026 3:24a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@jbampton jbampton added this to the Hacktoberfest 2026 milestone Oct 3, 2026
@jbampton jbampton self-assigned this Oct 3, 2026
@jbampton
jbampton requested a balanced review from Copilot October 3, 2026 03:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The focused metadata change correctly preserves existing fallbacks and non-profile behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Updates profile metadata to use each developer’s GitHub avatar while preserving the default image elsewhere.

Changes:

  • Uses the profile’s GitHub avatar for Open Graph and Twitter metadata.
  • Retains site.defaultImage when no GitHub username exists.
File Description
src/​_includes/​layouts/​base.njk Selects a profile-specific social image.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@jbampton jbampton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jbampton
jbampton merged commit 5b7f746 into NextCommunity:main Oct 3, 2026
16 checks passed
@jbampton jbampton changed the title Fix #499: use each profile's own GitHub avatar as its Open Graph image Use each profile's own GitHub avatar as its Open Graph image Oct 3, 2026
@jbampton

jbampton commented Oct 3, 2026

Copy link
Copy Markdown
Member

This has not fixed #499

But I merged it anyway thanks for this part of the fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Use each profile's own GitHub avatar as its Open Graph image

3 participants