Middleman::ImageOptim
Automatic image optimizer for Middleman v4 using image_optim gem.
Installation
Install image optimizers supported by image_optim, and then enable middleman-image_optim
gem in your Middleman project.
gem 'middleman-image_optim'
gem 'image_optim_pack' # optional -- some optimizers can be installed with this gem
Usage
Activate image_optim
extension in your Middleman configuration. Refer to the image_optim documentation for available options.
configure :build do
activate :image_optim,
cache_dir: File.join(__dir__, '.cache', 'image_optim'),
jpegtran: true,
optipng: true
end
License
The gem is available as open source under the terms of the MIT License.