Skip to content
Paper
Go back

Dynamic OG image generation in Paper blog posts

Edit page

OG images (aka social images) play an important role in social media engagement: they are displayed when a page is shared on a social network or a messaging app.

Introduction

Writing a post is enough: if the post has no image in its front matter, the Paper theme generates an Open Graph image (1200 × 628 pixels) with:

The image is published next to the post (e.g.: /posts/dynamic-og-images/og.png) and referenced by the built-in Cecil metatags. Other pages share an image generated with the title and the description of the site (/og.png), unless the site image option is set.

Requirements

Images are generated with the PHP GD extension, compiled with FreeType support. Without it, the default metatags behavior is used.

Customization

paper:
  og:
    dynamic: false

Use the image front matter variable to define the image of a post:

---
title: My post
image: /images/my-post.png
---

Edit page
Share this post: