OGCard

Automatic Open Graph images for Hugo and Jekyll

Static site generators make it easy to forget social images: every post shares the same logo, or no image at all. Generating images at build time usually means Node, Puppeteer or a plugin. With an image URL that renders on request, you only change one line in your <head>.

Hugo

In layouts/partials/head.html (or wherever your theme writes meta tags):

{{ $img := printf "https://rtekfsmupinxncwigmnf.supabase.co/functions/v1/og?title=%s&subtitle=%s&brand=%s&theme=ocean" (.Title | urlquery) (.Description | urlquery) (.Site.Title | urlquery) }}
<meta property="og:image" content="{{ $img }}">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">

Hugo escapes the & inside the attribute for you. If a post has its own image in front matter, keep it: wrap the block in {{ if not .Params.images }} … {{ end }}.

Jekyll

In _includes/head.html:

<meta property="og:image" content="https://rtekfsmupinxncwigmnf.supabase.co/functions/v1/og?title={{ page.title | url_encode }}&amp;subtitle={{ page.description | url_encode }}&amp;brand={{ site.title | url_encode }}&amp;theme=ocean">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">

If you use jekyll-seo-tag, set the image per page instead: image: path in front matter takes precedence, so add the tag above only to layouts where no image is set.

Make it look like your brand

Add &logo=https://yoursite.com/logo.png (PNG or JPG), and &bg=, &fg=, &accent= with 6-digit hex colors. Try combinations in the builder and copy the URL pattern.

Check the result

After deploying, paste a post URL into the Open Graph checker to see the Facebook, X, LinkedIn and Slack previews. Platforms cache cards, so a post shared before the change may keep its old preview for a while.

Free with a small "made with OGCard" mark. Pro removes the mark so every card carries only your brand.

Open the builder · Open Graph tag checklist