Skip to content

maliMirkec/hexo-cloudinary

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

Hexo tag to add images from Cloudinary

Resources

License

Stars

Watchers

Forks

Packages

No packages published