1.1.1 • Published 4 years ago

@zladuric/wintersmith-gallery v1.1.1

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
4 years ago

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.
1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

6 years ago