Overview
The Jekyll Srcset is a plugin for the Jekyll static site generator that simplifies the process of sending larger images to devices with high pixel densities. This plugin adds an image_tag Liquid tag, which allows users to generate and output the right images for different devices.
Features
- Easy image handling: The plugin provides an image_tag Liquid tag that makes it easy to generate and output the appropriate images for devices with high pixel densities.
- Automatic image resizing: The plugin generates up to three versions of each image, based on the specified width or height. The versions include the exact dimension specified, as well as versions that are twice and three times the size.
- srcset attribute: The plugin sets the generated images as a srcset attribute on the final image tag. This allows modern browsers to load the appropriate version of the image based on the pixel density of the device.
- Optipng integration: If the optipng tool is installed and in the PATH, the plugin can run it on all generated PNG images for optimization purposes.
- Caching support: The plugin can cache images between runs to optimize and speed up the resizing process.
Summary
The Jekyll Srcset plugin simplifies the process of handling images for devices with high pixel densities. It automatically generates and outputs the appropriate versions of images based on the specified dimensions. The plugin also supports optimization using the optipng tool and caching for performance optimization. Overall, the Jekyll Srcset plugin provides a straightforward solution for serving the right-sized images in modern browsers, with compatibility for older browsers as well.