Skip to content
Node.js service to automatically generate social media preview images for blog posts
JavaScript Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
CHECKS
Dockerfile
LICENSE
README.md
package.json
yarn.lock

README.md

og

Hosted at https://og.maximilianschmitt.me

Read the blog post: https://maximilianschmitt.me/posts/generate-social-media-preview-images/

Usage

In JavaScript:

const encodedText = encodeURIComponent(ogImageText);
const ogImageURL = `https://og.maximilianschmitt.me/${encodedText}.png`;

In HTML:

<meta
  property="og:image"
  content="https://og.maximilianschmitt.me/Hello%20world.png"
/>
<meta name="twitter:title" content="Hello world" />
<meta
  name="twitter:image"
  content="https://og.maximilianschmitt.me/Hello%20world.png"
/>
<meta name="twitter:card" content="summary_large_image" />

You can’t perform that action at this time.