Skip to main content
Use a single template for your blog’s share images. Pass each post’s title and category as page.templateData. The template keeps the canvas at 1200 × 630 pixels and wraps long titles within the same layout.

Render one image per post

Install the Doczilla Node SDK with npm install @doczilla/node. Set DOCZILLA_API_KEY and run node render-social-cards.mjs alongside the template.
render-social-cards.mjs

HTML

Save the HTML below as social-card.html. Handlebars escapes text passed through double braces.
social-card.html

Output

Fieldnotes social card titled Release notes for May

Short title

Fieldnotes social card with a long title about writing release notes

Long title wrapped within the same canvas

Publish the images at publicly accessible URLs for your pages’ og:image tags. The sample clips titles that exceed three lines. Preview your longest titles before publishing. See the Templating guide for more ways to reuse layouts.