Appearance
Blog Post Template
Designed specifically for blog posts and articles with author attribution.
Template ID
template: "blog"Preview
A content-focused layout featuring:
- Prominent title
- Author name and avatar
- Reading time indicator
- Professional gradient background
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Article headline |
subtitle | string | No | Article excerpt or description |
author_name | string | No | Author's display name |
author_avatar_url | string | No | Author's profile photo URL |
reading_time | string | No | Estimated reading time |
theme | string | No | dark (default) or light |
logo_url | string | No | Publication/brand logo |
Example Request
bash
curl -X POST https://ogimageapi.io/api/generate \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"title": "10 JavaScript Tips for Cleaner Code",
"subtitle": "Write more readable and maintainable JavaScript",
"author_name": "Sarah Chen",
"author_avatar_url": "https://example.com/sarah.jpg",
"reading_time": "5 min read",
"template": "blog",
"theme": "dark"
}' \
--output blog-og.pngLayout Structure
┌─────────────────────────────────────────┐
│ │
│ [Logo] │
│ │
│ ┌─────────────────────────────────┐ │
│ │ Title Goes Here │ │
│ │ (Large, Bold) │ │
│ └─────────────────────────────────┘ │
│ │
│ Subtitle text appears here... │
│ │
│ ┌──────┐ │
│ │Avatar│ Author Name · 5 min read │
│ └──────┘ │
│ │
└─────────────────────────────────────────┘Theme Variations
Dark Theme
- Rich, professional gradient
- High-contrast white text
- Avatar with subtle border
- Perfect for tech and developer blogs
Light Theme
- Clean white/gray background
- Dark text for readability
- Soft shadows and borders
- Great for lifestyle and business content
Use Cases
| Content Type | Recommended Setup |
|---|---|
| Tech tutorials | Dark theme + avatar |
| News articles | Light theme + logo |
| Opinion pieces | Dark theme + author |
| How-to guides | Either theme |
| Listicles | Dark theme |
Best Practices
- Always include author — Builds trust and recognition
- Use real avatars — Stock photos feel impersonal
- Add reading time — Sets expectations for readers
- Keep titles scannable — Use numbers or power words
Integration Example
Next.js Blog
javascript
// pages/blog/[slug].js
export async function getStaticProps({ params }) {
const post = await getPost(params.slug);
// Generate OG image
const ogResponse = await fetch('https://ogimageapi.io/api/generate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.OG_IMAGE_API_KEY
},
body: JSON.stringify({
title: post.title,
subtitle: post.excerpt,
author_name: post.author.name,
author_avatar_url: post.author.avatar,
reading_time: `${post.readingTime} min read`,
template: 'blog',
theme: 'dark'
})
});
// Save image to public folder
const imageBuffer = await ogResponse.arrayBuffer();
fs.writeFileSync(`./public/og/${params.slug}.png`, Buffer.from(imageBuffer));
return { props: { post } };
}WordPress Integration
php
function generate_og_image($post_id) {
$post = get_post($post_id);
$author = get_the_author_meta('display_name', $post->post_author);
$response = wp_remote_post('https://ogimageapi.io/api/generate', [
'headers' => [
'Content-Type' => 'application/json',
'X-API-Key' => get_option('og_image_api_key')
],
'body' => json_encode([
'title' => $post->post_title,
'subtitle' => get_the_excerpt($post_id),
'author_name' => $author,
'template' => 'blog',
'theme' => 'dark'
])
]);
// Save and attach image to post
// ...
}Avatar Specifications
| Property | Recommendation |
|---|---|
| Format | PNG or JPG |
| Size | 200×200 px minimum |
| Aspect ratio | 1:1 (square) |
| File size | Under 500KB |
The avatar will be automatically cropped to a circle.
Related Templates
- Profile Card — For team/about pages
- Social Share — More CTA-focused