@kur4ge/hexo-link-short

1.0.1 • Public • Published

hexo-asset-path

npm version

This plugin can automatically extract external links in articles, and use YOURS api to automatically shrink them into short links.

Installation

$ npm install @kur4ge/hexo-link-short --save

Usage

Setting up the configuration in _config.ymal

link_short:
  enable: true

  # When forceShort is true, link_short will also work when serving locally(hexo s).
  forceShort: false
  
  # yoursApi url
  yoursApi: https://yourls/yourls-api.php

  # yours Token, you can found in https://yourls/admin/tools.php
  token: ********
  # or you can set username and password
  username:
  password:

  # Need install plugin https://github.com/kur4ge/bulk-shortener in yourls
  # When enabled, multiple links will be shortened in one request
  bulkShortener: true

  # Selectors and attribute names for getting the elements to update.
  selectors:
    a[href]: href

Debugging

The posts and links we updated is outputted to the hexo log. Just simply enable debug mode and logging in hexo, then you can see it.

hexo s --debug --log

License

BSD v3

Package Sidebar

Install

npm i @kur4ge/hexo-link-short

Weekly Downloads

1

Version

1.0.1

License

BSD-3-Clause

Unpacked Size

10.4 kB

Total Files

4

Last publish

Collaborators

  • kur4ge