The project is in a healthy, maintained state
A Jekyll plugin to generate image thumbnails with specified width.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

jekyll-thumbnail-img

A Jekyll plugin to generate image thumbnails with specified width.

Installation

Add the following to your Gemfile:

gem 'jekyll-thumbnail-img'

And then add the plugin to your _config.yml:

plugins:
  - jekyll-thumbnail-img

Usage

The plugin provides a Liquid filter thumbnail_img as follows:

{% thumbnail_img <path to image> <width in pixels> %}

This can be used in img tags as follows:

<img src="{% thumbnail_img path/to/image.jpg 500 %}">

This will generate a thumbnail of width 500px with the same aspect ratio as the original image in the directory path/to/thumbnails with the name image_500w.jpg which will be used as the src attribute of the img tag.

Alternatively, Jekyll variables can be used as follows:

<img src="{% thumbnail_img page.image_path 500 %}">