redwoodjs / playground-auth

This repo demonstrates all the authentication providers that Redwood supports
https://redwood-playground-auth.netlify.app/
MIT License
34 stars 25 forks source link

Add SEO and Social Card Images using Helmet and Netlify DPR functions #34

Open dthyresson opened 3 years ago

dthyresson commented 3 years ago

Add SEO and Social Card Images using Helmet and Netlify DPR functions

See: https://www.netlify.com/blog/2021/04/14/faster-builds-for-large-sites-on-netlify-with-on-demand-builders-now-in-early-access/

TODO - DT to explain.

lunchbreakdev commented 3 years ago

Is this like creating dynamic social cards? I've always wondered how to do that

dthyresson commented 3 years ago

Is this like creating dynamic social cards? I've always wondered how to do that

It is! There are some cool new options now available thanks to DPR functions.

I'll do a write up later today of how I think it could work.

If you want to start thinking about the general shape, design and content and post a PR as a Draft, I can fill in the tech details later today.

Not too far from:

image

but with some RedwoodJS logo watermark etc.

I might want to try out https://imagekit.io/ and also Supabase Storage https://supabase.io/blog/2021/03/30/supabase-storage for storing the blanks.

The easy way is create an image per provider - but that's a pain to scale and need a designer to make one per.

Instead think of it like compositing and image with a background and then overlaying a logo and adding text.

See: https://docs.imagekit.io/features/image-transformations/overlay and the other docs

lunchbreakdev commented 3 years ago

Very cool! I can definitely take a look into creating the design for the image. The technical side might be a bit too advanced for me at the moment. I want to learn for a few projects I'm working on, so I'm excited to see how this gets executed.

dthyresson commented 3 years ago

@morganmspencer I am read to start this up again using Netlify's new DPR functions.

Can you post in here some image mockups? Or at least some of the assets you might use to compose the image.

I have Imagekit setup to store the images (though may switch to Supabase) and Imagekit to do the transforms, but need to figure out a way for you to easily upload those image assets to make it easier to implement.

Or - I guess you could create your own free Imagekit account. That might be best.

I'll post a PR with a stubbed out DPR function that returns an image and perhaps you can take it from there.

Thanks!

lunchbreakdev commented 3 years ago

@dthyresson I can post some mockups here in a bit

dthyresson commented 3 years ago

I can post some mockups here in a bit

Thanks! If you do, could you also attach the individual image components -- if you are overlaying some (like a watermark logo) or other elements.

See: Chained Transformations -> https://docs.imagekit.io/features/image-transformations/chained-transformations Overlays and Text Overlays (Supported fonts here: https://docs.imagekit.io/features/image-transformations/supported-text-font-list)

lunchbreakdev commented 3 years ago

Is it possible to have a set background image that has the RW logo already on it and then place the variable text over it?

Also, would we be able to dynamically add the provider logo as well? Or is it just text-based changes?

dthyresson commented 3 years ago

Is it possible to have a set background image that has the RW logo already on it and then place the variable text over it?

Both options are possible:

Also, would we be able to dynamically add the provider logo as well? Or is it just text-based changes?

You can overlay text or images

dthyresson commented 3 years ago

See: https://docs.imagekit.io/features/image-transformations/chained-transformations#example for a logo image overlay

lunchbreakdev commented 3 years ago

Here are some starting points to initiate a discussion:

General Provider

Social post

Provider with Help Wanted

Social post

dthyresson commented 3 years ago

So, a simple way to implement this w/out ImageKit is just to make all flavor variants and then convert to a base64 image and have DPR make that or even Helmet just include the image ... but that's no fun ;)

@morganmspencer

Can you add here:

I'll add these to ImageKit as well as the logos.

Then can try some compositing w/ the centered logo and even a www address text overlay.

Then I can DM you the ImageKit secret api tokens to test.

lunchbreakdev commented 3 years ago

Blank cards:

Social post

Social post

dthyresson commented 3 years ago

Thanks @morganmspencer . I've uploaded the assets to Supabase storage. I'll work in morning to stub out the DPR using the storage source and then get you the ImageKit info.