1.1.1 • Published 8 months ago

@simbafs/og v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

getOG

statically generate og image in png based on provided information

Installation

$ npm i @simbafs/og

usage

CLI

$ node index.js path/to/your/post.md
Usage: index [options] <input> [output]

Arguments:
  input              the input markdown file
  output             the output png file, default og/${input}

Options:
  --author <name>
  --font <path>
  --template <path>
  -h, --help         display help for command

the generated og image will be placed in og/path/to/your/post.png

Lib

const { getOg, getOgFromMd } = require('@simbafs/og')
const fs = require('fs')

getOg({ 
    title: 'Auto Generate OG Image',
    subtitle: '2023/08/29 by SimbaFs',
    tags: ['og', 'image', 'svg'],
}).then(({ png, svg} => fs.writeFileSync('og.png', png))

// or auto read and write
getOg({
    inFile: 'path/to/your/post.md',
    outFile: 'og.png',
})

og

Batch

To generate og images in batches, you can try my script. I may integratein to this in the future.

Docs

getOg

TODO

getOgFromMd

TODO

1.1.1

8 months ago

1.1.0

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago