Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

hexo-cloudinary

0.1.5 • Public • Published

hexo-cloudinary NPM version Dependency Status

Hexo tag to add an image from Cloudinary - with srcset support

Install

Install using npm.

npm install hexo-cloudinary --save

Install using yarn.

yarn add hexo-cloudinary

Usage

{% cloudinary src srcset [alt] [class] %}

where:

  • src - path to image
  • srcset - srcset sizes in following format
    • small_width=small_cloudinary_transformation_id;big_width=big_cloudinary_transformation_id
    • default false - no srcset
  • alt - image title (optional)
  • class - custom class (optional)

Example

{% cloudinary http://res.cloudinary.com/USER_NAME/image/upload/IMAGE_NAME.png 320px=c_scale,q_auto:good,w_320;640px=c_scale,q_auto:good,w_640 "My image title" "my-image-class" %}

<img src="http://res.cloudinary.com/USER_NAME/image/upload/c_scale,q_auto:good,w_640/IMAGE_NAME.png" alt="My image title" srcset="http://res.cloudinary.com/USER_NAME/image/upload/c_scale,q_auto:good,w_320/IMAGE_NAME.png 320w, http://res.cloudinary.com/USER_NAME/image/upload/c_scale,q_auto:good,w_640/IMAGE_NAME.png 640w" sizes="(max-width:320px) 320px,  640px">

License

MIT

NPM downloads

install

npm i hexo-cloudinary

Downloadsweekly downloads

4

version

0.1.5

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability