Tcardgen screenshot

Tcardgen

Author Avatar Theme by Ladicle
Updated: 10 Jan 2026
189 Stars

Generate a TwitterCard(OGP) image for your Hugo posts.

Overview

The Twitter Card Image Generator is a tool that allows you to generate Twitter card (OGP) images for your blog posts. With support for front-matters such as title, author, categories, tags, and date, as well as both toml and yaml formats, this tool provides an easy and efficient way to create visually appealing images for your Twitter cards.

Features

  • Generate Twitter card (OGP) images for your blog posts
  • Supports front-matters including title, author, categories, tags, and date
  • Supports both toml and yaml formats
  • Easy installation and setup
  • Ability to customize the color, style, and position of text
  • Generates images with the same name as the specified content
  • Ability to generate images only for updated articles

Installation

To install the Twitter Card Image Generator, follow these steps:

  1. If you have Go version less than 1.16, upgrade to Go 1.16 or higher.
  2. Install the tcardgen command.
  3. Download your favorite TrueType fonts. The provided sample uses KintoSans.
  4. Create a template image by replacing the author image of the template in the example directory.
  5. Run the following command to generate the Twitter card image:
tcardgen --config [configuration_file] [content]

Note: Make sure your font files follow the naming rule (<name>-<style>.ttf) and are arranged properly.

Summary

The Twitter Card Image Generator is a powerful tool for generating Twitter card images for your blog posts. With its support for various front-matters and formats, easy installation process, and customization options, this tool provides a convenient way to enhance the visual appeal of your blog posts on Twitter.