Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abpaudel/jekyll-thumbnail-img

A Jekyll plugin to generate image thumbnails with specified width.
https://github.com/abpaudel/jekyll-thumbnail-img

jekyll jekyll-plugins ruby-gem

Last synced: about 2 months ago
JSON representation

A Jekyll plugin to generate image thumbnails with specified width.

Awesome Lists containing this 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 %}
```
This can be used in `img` tags as follows:
```

```
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:
```

```