@zladuric/wintersmith-gallery

1.1.1 • Public • Published

Wintersmith Gallery Plugin

This plugin lets you publish directories with images in them.

It then creates galleries index page with links to individual galleries (directories) and those individual galleries as one page for each directory containing accepted images.

Usage

  1. Install the plugin
  2. Add it to config
  3. Add the templates and JavaScript

1. Install the plugin

npm i @zladuric/wintersmith-gallery

2. Add it to config

Include the plugin in config.json:

"plugins": [
    "@zladuric/wintersmith-gallery"
],

3. Add the templates and JavaScript

Create the templates and styling and things.

Example:

That's it. if you drop a directory full of images under contents/galleries and wintersmith build the site, you'll have a bunch of new pages with your images.

Configuration

You should configure the plugin in config.json:

{
    "template": "gallery.pug",
    "indexTemplate": "galleries-index.pug", 
    "galleries": "galleries", 
    "validImageTypes": ["png", "jpg", "jpeg"], // which types of templates are valid for inclusion
    "galleriesIndex": "galleries/index.html",
    "galleryPageIndex": "==GALLERY==/index.html"
    "perPage": 10,
    "galleriesRootMandatory": true
}

Options (option name [default]: description):

  • template [galery.pug]: template for individual gallery, example
  • indexTemplate [galleries-index.pug]: template for index page with links to all galleries, example
  • galleries [galleries]: where under contents to look for galleries directories
  • validImageTypes [["png", "jpg", "jpeg"]]: which types of templates are valid for inclusion. Note: only checked by file extension.
  • galleriesIndex [galleries/index.html"]: filename for the index page
  • galleryPageIndex [==GALLERY==/index.html]: filename for the individual gallery. Note: MUST include the string ==GALLERY==.
  • galleriesRootMandatory [true]: fail the build if there's no root directory for galleries.

Package Sidebar

Install

npm i @zladuric/wintersmith-gallery

Weekly Downloads

1

Version

1.1.1

License

MIT

Unpacked Size

12.4 kB

Total Files

12

Last publish

Collaborators

  • zladuric