A Jekyll plugin to thumbnailify any image.
This plugin will read an image file from your image folder, produce a thumbnail version of it and render this html
<a class="image" href="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/images/foobar.png"><img src="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/images/foobar_t.png" /></a>
This way, you can the use any JS plugin to add easily an effect going from the thumbnail image to the real image. For instance, you can use:
- fancyBox 2
- Lightbox 2
- Many others
- Install mini magick:
gem install mini_magick
(or usegem "mini_magick"
in your gemfile and thenbundle install
) - At the root of your site, if you don't have one, create a folder called
_plugins
- Copy jekyll-thumbnailify.rb:
wget https://raw.github.com/10io/jekyll-thumbnailify/master/jekyll-thumbnailify.rb
(if you don't have wget, brew it!)
- At the root of your site, put all your images in a folder called images
- In any page of your Jekyll site, use
{% t foo.png %}
to generate the thumbnail image and the link
- the image folder name(by default, images) can be configured in the _config.yml file using the images_directory variable
- the images_directory can point to a subfolder, for example: images/posts
- the css class name(by default, image) of the generated link can be configured in the _config.yml file using the images_css_class variable