Skip to content
This repository has been archived by the owner on Mar 17, 2019. It is now read-only.

yutahaga/hexo-filter-variant-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hexo-filter-variant-images

npm version

It is a Hexo plug-in for generating thumbnails etc. using ImageMagick.

Since you can freely set arguments, you can generate various kinds of images as well as thumbnails.

Required environment

  • ImageMagick

Installation

npm install hexo-filter-variant-images --save

Configuration

# variant images
variant_images:
  cmd: 'magick'
  match: '**/*.{jpg,gif,png}'
  match_options:
    debug: true
  exclude: 'static/**/*'
  priority: 5
  items:
    - suffix: '@preview'
      extension: 'gif'
      size: '20x20'
      blur: '1.5'
      posterize: '16'
      args: '-resize $size -blur $blur -posterize $posterize'
    - suffix: '@small'
      size: '120x120'
      args: '-resize $size'

cmd

Run command. The default value is magick.

Also I am only checking the operation with magick.

match

Specify the path of the target image file with glob.

The default value is **/*.{jpg,gif,png}

match_options

Option for minimatch. The default value is empty.

For details Minimatch#options

exclude

Specify the path of the file to be excluded with glob. The default value is empty.

priority

Specify the priority of the filter by numerical value. The default value is 5.

For details Filter | Hexo

items

Variations to generate. Required items are suffix, args

suffix

Suffix of the generated image.

extension

Extension of the generated image. If unspecified, it will have the same extension as the original image.

args

Arguments to pass to the command. If you write it like $size, you can refer to the settings in the same item.

items:
  - suffix: '@preview'
    extension: 'gif'
    size: '20x20'
    blur: '1.5'
    posterize: '16'
    args: '-resize $size -blur $blur -posterize $posterize'
  - suffix: '@small'
    args: '-resize 120x120'

About

A plug-in to generate variant images

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published