nystudio107 / craft-seomatic

SEOmatic facilitates modern SEO best practices & implementation for Craft CMS 3. It is a turnkey SEO system that is comprehensive, powerful, and flexible.
https://nystudio107.com/plugins/seomatic
Other
165 stars 70 forks source link

Sitemap using large source images - is it possible use a transform or similar #1407

Closed ChrisAtRyze closed 5 months ago

ChrisAtRyze commented 8 months ago

One of our sites has had an SEO audit and they've pointed out the large images being listed in the sitemap that SEOmatic has automatically taken from the entries. This is because they're source images taken straight from the asset field. Is it possible to edit the functionality to specify a transform to list out smaller versions of these images? We can of course reduce the source image sizes manually but this would potentially risk the quality of the images on the site.

Thanks

khalwat commented 8 months ago

There is no facility for doing this, unfortunately. SEOmatic only automatically knows about the Assets you've added to an entry.

It would be possible for SEOmatic to throw an event that you could listen for via a custom module or plugin, and provide the transformed image to use, if that would be useful to you, though?

khalwat commented 8 months ago

Let me know if you want such an event added @ChrisAtRyze

ChrisAtRyze commented 8 months ago

Hi @khalwat thanks for the quick response and apologies for not replying sooner. It would definitely be helpful however I'm just waiting on the go-ahead before implementing something custom. I'll let you know asap

khalwat commented 8 months ago

Okay no worries. It wouldn't difficult to add, and on your end should be pretty easy to implement.

ChrisAtRyze commented 8 months ago

Hi @khalwat ok, cool. I've been given the go-ahead so I can implement it when you're able to add the event. Thanks for your help!

ChrisAtRyze commented 7 months ago

Hi @khalwat, if you're still cool to add this event, it'd be great to know when you think it'll be added in.

Thanks!

khalwat commented 7 months ago

Roger that, will re-open it and get the event added

ChrisAtRyze commented 6 months ago

Hi @khalwat

Sorry to bother you, but when do you think you'll be able to implement this change so their audit can be satisfied as I'm being chased about it?

Cheers

khalwat commented 6 months ago

I should be able to get it in the next release.

ChrisAtRyze commented 6 months ago

@khalwat brilliant, thank you! Do you have an idea of when that might be so I can let them know?

khalwat commented 5 months ago

Added in the above commits. I decided to make it even easier: you just need to create an Image Transform and choose it in the new Sitemap Asset Transform setting in SEOmatic -> Content SEO -> (section) -> Sitemap settings

Craft CMS 3:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop as 3.4.75”,

Then do a composer clear-cache && composer update

…..

Craft CMS 4:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop-v4 as 4.0.46”,

Then do a composer clear-cache && composer update

…..

Craft CMS 5:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-seomatic": "dev-develop-v5 as 5.0.0”,

Then do a composer clear-cache && composer update

ChrisAtRyze commented 5 months ago

Awesome, thanks! I'll give it a go