Auto-markup M;tG card name.

Usage no npm install needed!

<script type="module">
  import hexoMtgCardJp from 'https://cdn.skypack.dev/hexo-mtg-card-jp';




Mark up MTG card name

Mark-up MTG card name in hexo's post. hexoのpost中に書かれたmtgのカードを、任意の形式でマークアップする。

Make IMG tag

Create IMG tag from Nunjucks tag in your post. hexoのポスト中に書かれたNunjucksタグからIMG要素をつくる

This plugin use mtgjson.com .

How to use


Edit template

Modify plugins/mtg-card-jp/card.ejs in your theme directory to define format.

For example...

<span is="mtg_card"
<% if (card.types) { %> mtg_types="<%- card.types.join(' ').toLowerCase() %>"<% } -%>
<% if (card.colors) { %> mtg_colors="<%- card.colors.join(' ').toLowerCase() %>"<% } -%>
<% if (card.multiverseid) { %> mtg_multiverseid="<%- card.multiverseid %>"<% } -%>
><%- content %></span>

card.xxx is card data from mtgjson.com ( http://mtgjson.com/ ). content is original card name from your post.

Write card name into your post

For example...

《鐘突きのズルゴ/Zurgo Bellstriker(DTK)》

This plugins format that card name.

The example will be translated as...

<span is="mtg_card" mtg_types="creature" mtg_colors="red" mtg_multiverseid="394748">《鐘突きのズルゴ/Zurgo Bellstriker(DTK)》</span>

Create IMG tag

Please write like below in your post.

NOTE: Card set name is needed.

{% mtg_card 《兜砕きのズルゴ/Zurgo Helmsmasher(KTK)》 %}


$ npm install hexo-mtg-card-jp --save

And add _config.yml

- hexo-mtg-card-jp