Keeping your bunny finely-tuned for a hoppy life, mate!
BunnyMate integrates BunnyCDN with Craft CMS.
This plugin requires Craft CMS 5.0.0 or later.
This is a private plugin, made for Værsågod and friends.
ddev craft plugin/uninstall bunny && ddev composer remove vaersaagod/bunny
ddev composer require vaersaagod/bunnymate && ddev craft plugin/install _bunnymate
- Rename
config/bunny.php
toconfig/_bunnymate.php
<?php
return [
'pullingEnabled' => true,
'pullZones' => [
'default' => [
'hostname' => 'https://awesome-project.b-cdn.net',
'enabled' => true,
],
],
'defaultPullZone' => 'default',
];
BunnyMate provides a global Twig function bunnyPullUrl()
, which can be used to generate a Bunny CDN pullzone URL:
{% set bunnyUrl = bunnyPullUrl(asset) %}
{% set bunnyUrl = bunnyPullUrl(siteUrl('lorem/ipsim') %}
{% set bunnyUrl = bunnyPullUrl('lorem/ipsum') %}
{% set bunnyUrl = bunnyPullUrl('/lorem/ipsum', 'anotherZone') %}