DEV Community

Wachira
Wachira

Posted on

How does Dev.to give rich link image previews of articles with no cover images?

richlinkpreview
This is an article whose author did not provide a cover image but Dev.to is able to generate an image with the title. The image acts as a placeholder in rich link previews

My question is how can I do that.

Top comments (3)

Collapse
 
rhymes profile image
rhymes

DEV is using this service: HTML/CSS to Image API - basically you pass the markup and the styling and they give you back an image.

It's built by a DEV member, @mscccc :

Collapse
 
coreyja profile image
Corey Alexander

Wow this is perfect! I was just looking at Themer (themer.dev/), which can output backgrounds as SVGs that Chrome can load. This looks like an awesome programmatic way to convert these to 'standard' image formats!

Love when all my random browsings meld well together!

Collapse
 
wchr profile image
Wachira

Thanks @rhymes ,