ocaml.org icon indicating copy to clipboard operation
ocaml.org copied to clipboard

OG images for OCaml Packages

Open tmattio opened this issue 1 year ago • 6 comments

Task:

  • Implement an endpoint that renders a social media image for a package.
  • insert og:image and twitter:image tags on the package pages' head to reference this image, so that social media platforms will use it to render the card as preview.

https://www.figma.com/file/J0w4b9exaHhVpvabKoGqTn/Design-Github-Issues?type=design&node-id=552%3A109&mode=dev&t=GyDyisG71RSU3F46-1

v1_twitter_package_banner_1024x512px

tmattio avatar Nov 21 '23 17:11 tmattio

Task:

  1. determine OCaml libraries that can generate .png or .jpg images like this
  2. create an endpoint, which, given a package name and version, generates the image and serves it
  3. add HTML meta tags that tell social networks to use the image og:image twitter:image

sabine avatar Nov 27 '23 17:11 sabine

@sabine @tmattio I'd love to tackle this one next.

kiyov09 avatar Feb 16 '24 18:02 kiyov09

Hey @kiyov09 that would be awesome! The trickiest thing about this is identifying which packages / tools could be used.

As I understand, it's best to create JPG images, since not all social sites deal well with SVG images. However, one possible path would be to render SVG and convert that to JPG with some library or command line tool.

sabine avatar Feb 19 '24 09:02 sabine

Got it. I'll do a research and we can discuss the results. Is there any "design" for the cards?

kiyov09 avatar Feb 19 '24 16:02 kiyov09

When we know what data to list, I can give a napkin sketch to the designer to turn that into a design - but I haven't really thought about that yet.

I think taking inspiration for GitHub cards here, we won't be doing anything wrong.

sabine avatar Feb 20 '24 07:02 sabine

We have a design now at

https://www.figma.com/file/J0w4b9exaHhVpvabKoGqTn/Design-Github-Issues?type=design&node-id=552%3A109&mode=dev&t=GyDyisG71RSU3F46-1

v1_twitter_package_banner_1024x512px

sabine avatar Feb 20 '24 15:02 sabine