Download the PHP package justbetter/statamic-glide-directive without Composer
On this page you can find all versions of the php package justbetter/statamic-glide-directive. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download justbetter/statamic-glide-directive
More information about justbetter/statamic-glide-directive
Files in justbetter/statamic-glide-directive
Package statamic-glide-directive
Short Description Addon that adds a glide blade directive
License
Informations about the package statamic-glide-directive
Statamic Glide Directive
- 🚀 Automatic responsive images - Optimizes images for all devices automatically.
- ⚡ Performance boost - Serves correctly sized images, reducing load times and bandwidth.
- 🧩 Simple syntax - Clean
@responsive
directive replaces complex<picture>
tags. - 🔄 WebP support - Automatically delivers modern image formats to compatible browsers.
Installation
Usage
This package adds a Blade directive. You can use an asset in the directive, and it will render the image according to the presets defined in the config. Here's an example:
To allow images to change on resize, include this in your head:
Image Generation
Images are served directly through custom routes that properly handle the content type and caching. When a preset image is requested, it's generated on demand and stored in the public directory. If an image preset hasn't been generated yet, a placeholder will be used temporarily until the optimized version is ready.
We recommend pre-generating your presets for optimal performance:
Config
The package has default configurations. By default, it will use the presets defined in this addon's config. If you've defined your asset presets in the Statamic config, those will be used.
Default config:
Image Resize Threshold
This setting defines the threshold width for image source sets. Images wider than this threshold will be processed differently to optimize performance.
Placeholder
On page load, a small variant of the image will be loaded. To disable this, set the placeholder in the config file:
Sources
Configure which sources to use. By default, only WebP sources are used. You can also configure sources based on the image MIME type or use both.