Middleman Thumbnailer
Generate thumbnail versions of your jpeg & png images
Installation
Add this line to your Gemfile:
gem 'middleman-thumbnailer', '~> 0.1'Configuration
To activate generating thumbnails add the following to config.rb:
activate :thumbnailer,
:dimensions => {
:small => '200x',
:medium => '400x300'
},
:include_data_thumbnails => true,
:namespace_directory => %w(gallery)This activates the extension and will only process images in source/images/gallery.
For a file called background.png, versions named background-small-200x.png and background-medium-400x300.png will be generated in the same directory.
Config Options
-
:include_data_thumbnails:Boolean(Default:false) - Enables including a list all image versions generated as thedata-thumbnails-attribute for each image when using thethumbnail()helper -
:namespace_directory:Array(Default:nil) only process images found within this directory withinsource/images
Helpers
-
thumbnail(image, size, [html_options]): returns thumbnail a image tag forimageinsize -
thumbnail_url(image, size): returns the url forimageinsize