Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/clnhlzmn/jekyll-pig

A jekyll plugin to build a progressive image gallery using pig.js
https://github.com/clnhlzmn/jekyll-pig

Last synced: about 1 month ago
JSON representation

A jekyll plugin to build a progressive image gallery using pig.js

Awesome Lists containing this project

README

        

# jekyll-pig

This is a plugin that makes it easy to include progressive image galleries in your Jekyll site. Jekyll-pig is made possible with [minimagick](https://github.com/minimagick/minimagick) and [pig.js](https://github.com/schlosser/pig.js).

# How to use

## 1. install [ImageMagick](https://imagemagick.org)

## 2. add `- jekyll-pig` to the plugins list in your site's `_config.yml`

## 3. install jekyll-pig

Either add `gem jekyll-pig` to your site's `Gemfile` and run `bundle install` or run `gem install jekyll-pig`

## 4. add a section called `galleries` to your site's `_config.yml`

It should look like this:
```
galleries:
-
path:
name:
-

```
These lines tell jekyll-pig where to find your images and how to organize the generated output. `` shouldn't have any spaces.

## 5. add images to your gallery folders

## 6. add gallery folder paths to exclude list in `_config.yml` and to your `.gitignore`

## use `{% include .html %}` in your pages and posts to include a the gallery identified by `gallery-name`

## 7. run `jekyll build`

# What happens

## jekyll-pig generates a bunch of content
```

├── _data
│ ├── .json #data for a specific gallery (one for each gallery)
│ └── ...
├── _includes
│ ├── .html #gallery include file (one for each gallery)
│ └── ...
├── assets
│ ├── html
│ │ ├──
│ │ │ └── .html #an html page using layout: page for each image
│ │ └── ...
│ ├── img
│ │ ├──
│ │ │ ├── 20
│ │ │ │ ├── . #each image resized into various size thumbnails
│ │ │ │ └── ...
│ │ │ ├── 100
│ │ │ │ └── ...
│ │ │ ├── 250
│ │ │ │ └── ...
│ │ │ ├── 500
│ │ │ │ └── ...
│ │ │ └── 1024
│ │ │ └── ...
│ │ └── ...
│ ├── js
│ │ ├── pig.min.js #js required for the gallery
│ │ └── ...
│ └── ...
└── ...
```

# What you will see

Wherever you `{% include .html %}` you will see a progressive image gallery.

Check out [mine](https://colinholzman.xyz/gallery).

# Notes

Each image in a gallery is linked to generated page for that image. The default jekyll theme lists all pages at the top of every page. To keep all your image pages from cluttering your page listing the generate pages include `exclude: true` front matter. You can modify your `header.html` include file like this:

```
{%- if my_page.title and my_page.exclude != true -%}
{{ my_page.title | escape }}
{%- endif -%}
```

The above just prevents the page link from appearing if `my_page.exclude` is `true`.