JSPM

hexo-tag-blog-card

0.1.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q13742F
  • License MIT

Embed a blog card on your Hexo article.

Package Exports

  • hexo-tag-blog-card
  • hexo-tag-blog-card/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hexo-tag-blog-card) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hexo-tag-blog-card

NPM NPM hexo

Embed a blog card on your Hexo article.

Features

  • OGP(Open Graph Protocol) based blog card
  • Supports favicon and site name
  • Supports Hatena blog card style
  • Supports style configuration

Installation

npm install hexo-tag-blog-card

Usage

{% blogCard <url> [target:<target>] [rel:<rel>] [hatena:<true/false>] %}

Example:

{% blogCard https://www.amazon.com/ target:_blank rel:nofollow %}

Explantion of attributes

  1. url - An URL for the link. Required.
  2. target attribute - if you need to open link with another window, you must set here "_blank".
  3. rel attribute - if you need to link with rel="nofollow", set here "nofollow".
  4. hatena - if you can use Hatena Blog Card, set "true" (default: use global settings(useHatena))

Target attribute and rel attribute can be abbreviated. But if only target attribute abbreviated, will not work correctly.

If you need to open same window and set rel="nofollow", please write down like below.

Options

className

You can provide top-level class name of this preview link HTML. (Default: blog-card)

descriptionLength

You can provide number of character in og-description. (Default: 140)

faviconAPI

You can provide a favicon API with variables($URL, $DOMAIN). (Default: http://favicon.hatena.ne.jp/?url=$URL)

useHatena

You can use Hatena Blog Card if you set true. (Default: false)

timeout

You can provide number of timeout(milliseconds). (Default: 4000)

You can use Hatena Blog Card if you set true. (Default: false)

Example

_config.yml:

blogCard:
  className: sample
  descriptionLength: 6
  faviconAPI: http://www.google.com/s2/favicons?domain=$DOMAIN

or

blogCard:
  className: sample
  useHatena: true

Style

You can customize the style.

Example:

View in CodePen

Thanks

This plugin refers to the following OSS resources:

Thanks to them.

License

MIT