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 title of the post
- its author
- the title of the site
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
- The background of the image is
assets/paper/og-background.png: override it with your ownassets/paper/og-background.png(1200 × 628 pixels). - The fonts are
assets/paper/fonts/GoogleSansCode-Regular.ttfandassets/paper/fonts/GoogleSansCode-Bold.ttf. - Disable the generation with the
paper.og.dynamicoption:
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
---