GithubHelp home page GithubHelp logo

uran1980 / jekyllgallerytag Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mattvh/jekyllgallerytag

0.0 2.0 0.0 63 KB

Jekyll plugin to generate thumbnails from a directory of images and display them with a Liquid tag

jekyllgallerytag's Introduction

JekyllGalleryTag

Jekyll plugin to generate thumbnails from a directory of images and display them with a Liquid tag

Installation

  1. Install ImageMagick and the RMagick gem.
  2. Drop galleries.rb into your Jekyll site's _plugins folder.
  3. Add the following to your _config.yml and customize to taste.
gallerytag:
    dir: images/galleries
    url: /images/galleries
    thumb_width: 150
    thumb_height: 150
    columns: 4
  • dir — The path (relative to your top Jekyll directory) to the folder containing your gallery images.
  • url — The URL to your gallery folder.
  • thumb_width — The width, in pixels, you want your thumbnails to have
  • thumb_height — The height, in pixels, you want your thumbnails to have
  • columns — How many columns galleries should display when the Liquid tag is used.

Usage

Jekyll will automatically generate (during builds) thumbnails for any images in the folder specified in _config.yml. To display them in a post, you would use a Liquid tag set up like this:

{% gallery galleryname %}
subfolder/myfirstimage.jpg:: A caption!
subfolder/myseconfimage.png:: Another caption
subfolder/mythirdimage.jpg
subfolder/myfourthimage.png
subfolder/myfifthimage.jpg
{% endgallery %}

Jekyll will output some HTML that is (intentionally) similar to what WordPress does for galleries in posts, making it relatively simple to tweak your CSS. It will also add rel attributes to the links, which contain the "galleryname" text as shown in the above example. This makes is easy to integrate a lightbox script like FancyBox.

You can see it in action on my personal blog, here.

jekyllgallerytag's People

Contributors

mattvh avatar dmytro avatar

Watchers

James Cloos avatar Ivan Yakovlev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.