A simple image tag plugin for Hexo.
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Latest commit f62af76 Nov 23, 2017
Permalink
Failed to load latest commit information.
.gitignore Updated ignore list. May 21, 2017
LICENSE Initial commit Dec 24, 2016
README.md Add https protocol mod. Nov 23, 2017
index.js Improved code. Nov 23, 2017
package.json Add https protocol mod. Nov 23, 2017

README.md

Introduction

npm npm npm npm

This is a hexo tag plugin which allows you to embed an image stored on CDN host.

Installation

Run the following command in the root directory of Hexo:

npm install hexo-tag-imgurl --save

Then add your CDN url in your site _config.yml.

# Imgurl
# Important: This value starts without a protocol and it doesn't end with '/'.
# httpsMod: true | false 
# If the value not set, image url will automatically adapt to the site's protocol.
imgurl: example.com/images
httpsMod:

Usage

{% imgurl imagePath [class1,class2,classN] imgAttr %}

Example:

# Imgurl
# Important: This value starts without a protocol and it doesn't end with '/'.
imgurl: example.com/images
{% imgurl test-post/test.png ful-image alt:test.png %}

Will output the HTML:

<img src="//example.com/images/test-post/test.png" class="full-image" alt="test.png">

TODO

  • Delete images after sync.
  • No article path required.
  • Built-in third party sync.
  • Add test script.