Files
MC-SurvivalWiki-Tips/tips/2026-07-22-041-social-dynamic-og-image-share-previews.md

23 lines
1.2 KiB
Markdown

---
tip_number: 41
date: 2026-07-22
category: social
status: pending
---
# Tip #41 — Dynamic OG-Image share previews
**Date:** 2026-07-22
**Category:** social
**Source:** MC-Survival Wiki Daily Tip (cron @ 18:00 MESZ)
## Dynamic OG-Image share previews
Generate a server-side 1200x630 PNG preview for each recipe URL — item icons, recipe name, the wiki brand — using satori or @vercel/og, and cache it for a week. It solves the dead-link-preview problem where recipe URLs pasted into Discord or Slack show a generic wiki logo and the URL bar, which kills click-through. The signal is share analytics: links with rich previews get measurably more clicks on Discord than plain links, and the recipe URL is already the most-shared asset in the server's community. Caching by recipe-id for 7 days is the right balance — recipes change rarely, but you do not want to serve a stale preview for a renamed item.
## Implementation tips
1. Generate OG images server-side: 1200x630 PNG with item icons + recipe name. Use satori or @vercel/og.
2. Cache the PNG by recipe-id — recipes don't change often, cache for 7 days.
3. Add proper og:image, og:title, og:description meta tags on the detail route.