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

    0

    Version

    2.0.0

    License

    MIT

    Last publish

    Collaborators

    • fusepilot