Reference

File URLs

You can modify the URLs for file objects with our file::url component. This component is also responsible for building thumbnail URLs. This makes it very powerful. It can be used to let thumbnails be generated on different services like Cloudinary or Imgix, but it can also be used to host files in a different locations and load them from there.

/site/plugins/file-urls/index.php
Kirby::plugin('my/fileUrls', [
    'components' => [
        'file::url' => function (Kirby $kirby, $file, array $options = []) {
            return 'https://cloudinary.com/...';
        }
    ]
]);

Params

$kirby
Kirby instance
$file
The original file object
$options
All thumb options (width, height, crop, blur, grayscale)

Return:

string
The Thumbnail URL