next-wordpress-starter icon indicating copy to clipboard operation
next-wordpress-starter copied to clipboard

Social Preview Images

Open colbyfayock opened this issue 5 years ago • 10 comments

Can we provide generated social preview images for posts without requiring an additional service?

colbyfayock avatar Oct 01 '20 02:10 colbyfayock

https://github.com/tkrkt/text2png

colbyfayock avatar Oct 01 '20 02:10 colbyfayock

Support added to Post pages via https://github.com/colbyfayock/next-wordpress-starter/pull/91

We should add a "default" image that shows up on any page that doesn't have one specified as well as one for Pages

colbyfayock avatar Jan 31 '21 21:01 colbyfayock

hey @colbyfayock can I work on this with next-seo package?

avneesh0612 avatar Oct 04 '21 16:10 avneesh0612

hey! what did you haev in mind with using next-seo?

the original idea for the ticket was to work on top of https://github.com/colbyfayock/next-wordpress-starter/pull/91

where we're currently generating images for each post, but we're not generating images for any Pages which would also be handy

https://github.com/colbyfayock/next-wordpress-starter/blob/main/plugins/socialImages.js

im open to ideas with next-seo though if you think it adds particular value

this is currently how we're managing SEO metadata https://github.com/colbyfayock/next-wordpress-starter/blob/main/src/pages/posts/%5Bslug%5D.js#L67

colbyfayock avatar Oct 04 '21 16:10 colbyfayock

Next-SEO is more useful IMO because it is not linked to any other components and is very easy to use.

avneesh0612 avatar Oct 04 '21 16:10 avneesh0612

I don't think I'm following, does Next-SEO generate social images automatically?

colbyfayock avatar Oct 04 '21 16:10 colbyfayock

Umm no, I meant you can pass in the metadata, and images very easily. You can even have dynamic data like the image cover probably

avneesh0612 avatar Oct 04 '21 17:10 avneesh0612

yeah this particular ticket is about generating the images like we're doing for the Posts in the links I added there

while Next SEO looks nice i dont know that it's adding anything that we dont already have if im not mistaken

im open to a different solution though if you think there would be a lot of benefit, I would open a new issue for that discussion though

colbyfayock avatar Oct 04 '21 17:10 colbyfayock

Ah okay, I will try to do with the existing way.

avneesh0612 avatar Oct 04 '21 17:10 avneesh0612

the way i would imagine the change happening would be to modify the data collection inside this file:

https://github.com/colbyfayock/next-wordpress-starter/blob/main/plugins/socialImages.js#L28

currently its getting all posts, where it should also get the pages

then inside of the pages template, it needs to reference that image similar to how it does in posts

https://github.com/colbyfayock/next-wordpress-starter/blob/main/src/pages/posts/%5Bslug%5D.js#L147

colbyfayock avatar Oct 04 '21 17:10 colbyfayock