Hey there!
We would like to use imgix for images, so I thought writing a custom thumb generator is probably the best form of integrating it, since it would just mean calling $image->thumb()
.
I’ve had a look at the official docs and copy pasted the code. For imgix the only thing that needs to happen is replacing the hostname of the image URL:
<?php
Kirby::plugin('diesdasdigital/imgix-thumb', [
'components' => [
'thumb' => function (App $kirby, string $src, string $dst, array $options) {
return "http://diesdas-v3.imgix.net/".$src;
}
]
]);
But calling the $image->thumb()->url()
still returns the old url. What do I need to change?