Related posts thumbnail filter for Jekyll
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
LICENSE
README.md
thumbnail_filter.rb

README.md

Jekyll Thumbnail Filter

Related posts thumbnail filter for Jekyll.

Jekyll Thumbnail Filter is a custom liquid filter for related posts thumbnails in the Jekyll static site generator.

Installation

Copy thumbnail_filter.rb into your Jekyll _plugins folder.

Usage

The filter will generate a link with the related post thumbnail as background image in the next order:

  • thumbnail_image in the Front Matter
  • First image in the post content, hosted or external.
  • Default background image of .thumbnail class in the CSS.

Example:

Inside the site.related_post loop.

{{ post.content | thumbnail_url: post.url, post.title }}

See the examples content for full examples and output.

TODO

  • Bundle the filter as a ruby gem
  • Move output to tests