@post-cards/core is a small node library for generating OpenGraph images for social media sharing. π¬
Simply as opengraph.xyz describes:
Social networks and messaging apps use the Open Graph meta tags to display your website.
npm i @post-cards/core -Dimportgeneratefrom'@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,})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 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
Some resources:
Our CONTRIBUTING.md to get started with setting up the repo.
Our CODE_OF_CONDUCT.md if you contribute i'd appreciate sticking to our code of conduct.