Dynamic OG Image Generation
AstroPaper includes built-in dynamic OG (Open Graph) image generation using Satori.
What are OG Images?
Open Graph images are the preview images shown when you share a link on social media platforms like:
- Twitter/X
- Discord
- Slack
How Satori Works
Satori is a library that converts HTML and CSS to SVG. AstroPaper uses it to:
- Take your post title and description
- Apply a beautiful template
- Generate an SVG image
- Convert to PNG for compatibility
Automatic Generation
If you don’t provide an ogImage in your page configuration, AstroPaper generates one automatically:
{
"title": "My Blog Post",
"description": "This becomes part of the OG image",
"metadata": {
"ogImage": null
}
}
Custom OG Images
You can still provide custom images:
{
"seo": {
"openGraph": {
"image": "/images/custom-og-image.jpg"
}
}
}
OG Image Best Practices
- Dimensions: 1200x630 pixels (1.91:1 ratio)
- File Size: Keep under 8MB
- Text: Keep it readable at thumbnail size
- Branding: Include your logo or site name
Platform Integration
Our adapter extracts OG images from:
page.seo.openGraph.imagecontent.heroImagemetadata.image
If none are found, AstroPaper’s dynamic generation kicks in!