opengraph-images

Generate dynamic OpenGraph images with Next.js ImageResponse for social sharing.

21|2|Updated Nov 5, 2023
One-click install
npx skills add https://github.com/motormetrics/motormetrics --skill opengraph-images-motormetrics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opengraph-images
Source: https://github.com/motormetrics/motormetrics/tree/main/.claude/skills/opengraph-images
Command: npx skills add https://github.com/motormetrics/motormetrics --skill opengraph-images-motormetrics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create dynamic, branded OpenGraph images for social media sharing across Next.js apps, ensuring consistent visuals and faster preview rendering.

Core Features & Use Cases

  • Dynamic OG images using Next.js ImageResponse API
  • Font loading from assets/fonts (Geist) for consistent typography
  • Per-route OG generation (about, blog/[slug], coe) with caching headers

Quick Start

Generate a dynamic OpenGraph image for a given page slug.

Frequently Asked Questions about opengraph-images

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate dynamic OpenGraph images for social previews in Next.js?

Generate dynamic OpenGraph images in Next.js using the ImageResponse API to create consistent branded social previews across dynamic routes. This approach applies per-route OG image implementations specifying alt text, size, and contentType for accurate social sharing visuals.

Do I need specific fonts to create branded OG images with Next.js ImageResponse?

Yes, branded OG images require Geist fonts located in the assets/fonts directory for consistent typography. Loading these specific fonts ensures your social preview images maintain a uniform brand appearance across all dynamically generated pages.

Can I apply per-route OpenGraph image generation to dynamic pages like blog slugs?

Yes, per-route OG generation supports dynamic Next.js pages such as about, blog/[slug], and coe routes. Each route can specify its own alt text, size, and contentType while applying caching headers for faster preview rendering.

What's the best way to ensure consistent social preview visuals across a Next.js site?

The best way to ensure consistent social preview visuals is applying dynamic OpenGraph image generation across all site routes. Using Next.js ImageResponse with standardized Geist fonts and per-route configurations guarantees uniform branded previews.

Why are my dynamically generated OG images not rendering correctly on social platforms?

OG images may fail to render correctly if per-route implementations omit required specifications like alt, size, or contentType. Ensure your Next.js ImageResponse setup properly defines these parameters and includes Geist fonts from the assets/fonts directory.

Does OpenGraph image generation work with Next.js dynamic routes and caching headers?

Yes, OpenGraph image generation works seamlessly with Next.js dynamic routes by applying caching headers to per-route implementations. This integration supports dynamic pages like blog/[slug] while maintaining consistent branded previews through the ImageResponse API.