Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/abpaudel/jekyll-thumbnail-img
- Owner: abpaudel
- License: mit
- Created: 2023-11-02T15:25:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-14T18:58:25.000Z (10 months ago)
- Last Synced: 2024-07-17T15:20:18.400Z (7 months ago)
- Topics: jekyll, jekyll-plugins, ruby-gem
- Language: Ruby
- Homepage: https://rubygems.org/gems/jekyll-thumbnail-img
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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:
```![]()
```