dannysmith / dannyis-astro

dannyis-astro
0 stars 0 forks source link

Generate Header Images #4

Open dannysmith opened 1 year ago

dannysmith commented 1 year ago

In order for unfurling to work well we need header images as part of the opengraph suff (see dannysmith/dannyis-jekyll#13).

It should be possible to specify a header image in article frontmatter. Eg.

header_image: /public/images/myheader.jpeg

If this is present, we should probably use it as the header when unfurling (even if we don't display it on the site).

For articles where this isn't present, we should generate an image which includes the title, author etc. We could probably use Cloudinary to do this at build time somehow?

https://github.com/Princesseuh/astro-eleventy-img

Useful links

dannysmith commented 1 year ago

I already have sharp installed in the project, so I should use that to do the generation. I can probably do this at build time in the JS part at the top of a OGData.astro component which I use in my Layouts?