getgrav / grav-premium-issues

Official Grav Premium Issues repository to report problems or ask questions regarding the Premium products offered.
https://getgrav.org/premium
7 stars 2 forks source link

[seo-magic] image_name: wildcard support for active language #259

Closed aleclerc7 closed 2 years ago

aleclerc7 commented 2 years ago

Hello @rhukster,

Following issue #249, it would be very nice if a simple wildcard for the current site language was possible on image_name. And it is very easy to implement. This would give support for multilingual sites.

Something very simple like: header.??.jpg

And in the code if ('??' in string) then string = replace('??' with [active language])

This would be very useful. Right now domain-specific config is needed to bypass this limitation. This simple feature would make specific domain config not required. (And for those sites not having a domain per language, it would also work well.)

Thank you and kind regards.

rhukster commented 2 years ago

Actually i've just added automatic support.. so if you have image_name: 'sample-image.jpg, seomagic.jpg' configured, it will actually look for these in order: sample-image.en.jpg, seomagic.en.jpg, sample-image.jpg, seomagic.jpg Assuming that your current language is en.

aleclerc7 commented 2 years ago

This is even better! 👍 This will make things way simpler to manage. Thank you!