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

outloudvi/hexo-tag-cloudinary

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hexo-tag-cloudinary NPM version

{% cloudinary about.png alttext %}

Based on hexo-cloudinary by maliMirkec.

Install

Install using npm.

npm install hexo-tag-cloudinary --save

or if you are using GitHub Packages:

npm install @outloudvi/hexo-tag-cloudinary --save

Install using yarn.

yarn add hexo-tag-cloudinary

Usage

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

where:

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

Configurations

In _config.yml:

cloudinary:
    username: "your_user_name"   # Cloudinary username
    subdir: "myhexoblogimage"    # sub directory for your images
    default_srcset: ""           # srcset by default

Example

{% cloudinary "about.png" "My image title" "w_300,h_600,c_thumb,g_auto" "ui image" %}
<p><img class="ui image" src="https:/res.cloudinary.com/USER_NAME/image/upload/w_300,h_600,c_thumb,g_auto/ASSET_DIR/about.png" alt="My image title" ></p>

License

MIT

About

Hexo tag to add images from Cloudinary

Resources

License

Stars

Watchers

Forks

Languages

  • JavaScript 100.0%