[PR #8234] [MERGED] fix(docs): use blog post header image as OG image #7839

Closed
opened 2026-03-13 13:50:43 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8234
Author: @Copilot
Created: 3/1/2026
Status: Merged
Merged: 3/1/2026
Merged by: @himself65

Base: canaryHead: copilot/fix-og-image-loading-issue


📝 Commits (3)

  • ea833a2 Initial plan
  • aa40a57 fix(docs): use blog post header image as OG image instead of default
  • a365e72 chore: remove accidentally committed package-lock.json

📊 Changes

1 file changed (+14 additions, -2 deletions)

View changed files

📝 landing/app/blog/[[...slug]]/page.tsx (+14 -2)

📄 Description

Blog post OG images always fall back to the default /og.png because generateMetadata never passes the post's image field to openGraph/twitter metadata.

  • Include image from blog post front matter in openGraph.images and twitter.images when present
const { title, description, image } = page.data;
return {
  title,
  description,
  ...(image && {
    openGraph: { images: [image] },
    twitter: { card: "summary_large_image" as const, images: [image] },
  }),
};

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Summary by cubic

Fixes OG/Twitter images for blog posts by using the post header image when available, so link previews show the correct image. Defaults remain when no header image is set.

  • Bug Fixes
    • Include the post image in openGraph.images and twitter images (summary_large_image).
    • Use the default image only when a post image is missing.

Written for commit aa40a577e7. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/8234 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 3/1/2026 **Status:** ✅ Merged **Merged:** 3/1/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `copilot/fix-og-image-loading-issue` --- ### 📝 Commits (3) - [`ea833a2`](https://github.com/better-auth/better-auth/commit/ea833a2be9fd22dd1c9b06d3c341d756e9c93ee7) Initial plan - [`aa40a57`](https://github.com/better-auth/better-auth/commit/aa40a577e70f1c876f79d62b1785668e381bd1f7) fix(docs): use blog post header image as OG image instead of default - [`a365e72`](https://github.com/better-auth/better-auth/commit/a365e72f122e2792d76a81dac3bb2f0f9b0f116f) chore: remove accidentally committed package-lock.json ### 📊 Changes **1 file changed** (+14 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `landing/app/blog/[[...slug]]/page.tsx` (+14 -2) </details> ### 📄 Description Blog post OG images always fall back to the default `/og.png` because `generateMetadata` never passes the post's `image` field to `openGraph`/`twitter` metadata. - Include `image` from blog post front matter in `openGraph.images` and `twitter.images` when present ```tsx const { title, description, image } = page.data; return { title, description, ...(image && { openGraph: { images: [image] }, twitter: { card: "summary_large_image" as const, images: [image] }, }), }; ``` <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes OG/Twitter images for blog posts by using the post header image when available, so link previews show the correct image. Defaults remain when no header image is set. - **Bug Fixes** - Include the post image in openGraph.images and twitter images (summary_large_image). - Use the default image only when a post image is missing. <sup>Written for commit aa40a577e70f1c876f79d62b1785668e381bd1f7. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 13:50:43 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#7839