npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

wintersmith-image-generator

2.0.0 • Public • Published

wintersmith-image-generator

Image generator for Wintersmith using gm.

Installing

Install globally or locally using npm

npm install [-g] wintersmith-image-generator

And add wintersmith-image-generator to your config.json.

{
  "plugins": [
    "wintersmith-image-generator"
  ]
}

Then configure the versions you'd like to generate.

{
  "images": {
    "match": "**/pictures/*.jpg",
    "versions": {
      "small": {
        "resize": [300, 300]
      },
      "large": {
        "resize": [800, 800],
        "sepia": ""
      }
    }
  }
}

You can use most of the methods specified in the gm docs listed here.

Then use the generated version in your templates.

h2 original images
- for image in page.parent.pictures._.files
  img(src=image.url)
 
h2 resized images
- for image in page.parent.pictures._.images_small
  img(src=image.url)

install

npm i wintersmith-image-generator

Downloadsweekly downloads

7

version

2.0.0

license

MIT

last publish

collaborators

  • avatar
Report a vulnerability