Skip to content

Repository files navigation

post-cards πŸ“¬

Coverage StatusContributor Covenant

@post-cards/core is a small node library for generating OpenGraph images for social media sharing. πŸ“¬


What is OpenGraph?



Simply as opengraph.xyz describes:

Social networks and messaging apps use the Open Graph meta tags to display your website.

Getting Started

npm i @post-cards/core -D
importgeneratefrom'@post-cards/core'importBasicTemplatefrom'@post-cards/basic-template'awaitgenerate(newBasicTemplate({text: '#fff',background: '#000',accent: 'orange',}),[{output: 'media/home-page.png',data: {title: 'My great Home Page',},},{output: 'media/about-page.png',data: {title: 'My great About Page',},},],{concurrency: 10,
...options,})

Template override

Sometimes you might not want the same template for each item but still want to batch them together.

awaitgenerate(Template,[{output: 'media/first-image.jpg',data: {}},{output: 'media/second-image.jpg',data: {},options: {templateOveride: FancyTemplate},},])

Creating Templates

Creating template is an easy process, if you've ever worked with html canvas, creating templates should be a breeze, and we provide some utils to smooth out the process.

For more information: Templates

Contributting Guide

Some resources:

License

MIT

About

@post-cards/core is a small node library for generating OpenGraph images for social media sharing. πŸ“¬

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages