Skip to content

Add social link preview image and Open Graph tags - #15

Merged
nlaverdure merged 1 commit into
mainfrom
social-preview-image
Oct 9, 2026
Merged

nlaverdure merged 1 commit into
mainfrom
social-preview-image

Conversation

@nlaverdure

Copy link
Copy Markdown
Member

Summary

  • Links to team2363.org shared on Facebook, Slack, Discord, iMessage and similar apps have no preview image today. The site has no Open Graph or Twitter card tags, so each platform guesses or shows nothing.
  • Base.astro now adds og:title, og:description, og:url, og:image (with width, height and alt text), og:type, og:site_name and twitter:card: summary_large_image to every page. Title and description come from each page's existing props.
  • The image is the original, un-darkened version of the homepage hero photo, src/layouts/ZCZ_9632-Enhanced-NR.jpg. The repo copy is resized from 5837×3648 (27 MB) to 2400×1500 (1.2 MB). Astro's getImage crops it to 1200×630 at build time, so the repo holds only one copy.
  • The camera's EXIF metadata was dropped during the resize. The color profile is kept.

Testing

  • astro build succeeds on this branch. The built index.html contains all the tags, and og:image resolves to https://team2363.org/_astro/ZCZ_9632-Enhanced-NR.<hash>.jpg.
  • The generated image is 1200×630, 186 KB. I checked the crop visually: the 2363 bumper and the student are both in frame.
  • The output from the resized source matches the output from the full-size original (same average RGB, 139/99/91).
  • prettier --check src/layouts/Base.astro passes.
  • Not yet tested: how the live platforms render the preview. After deploy, check with Facebook's Sharing Debugger or opengraph.xyz. That also refreshes any cached preview.

🤖 Generated with Claude Code

Every page now declares og:title, og:description, og:url, og:image and
a summary_large_image Twitter card. The preview image is the original
hero photo (resized to 2400px wide for the repo), cropped to 1200x630
at build time with getImage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nlaverdure
nlaverdure merged commit c51d5be into main Oct 9, 2026
1 check passed
@nlaverdure
nlaverdure deleted the social-preview-image branch October 9, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant