hexo plugin to display mtg cards

I love Magic the Gathering (mtg) and the cards from it, especially the artworts.
Building decks to play with, is one of the most enjoying parts of it for me, and of course sharing them with others ;)
Hexo itself does not have an “easy, small and fast” plugin to display cards in a post, so i did one myself.

with this script you could:

  • display a single card
  • display name of the card with tooltip of the image
  • show a decklist

it gathers its informations from the scryfall api.

just add a scripts folder in hexo root and add the script of the gist and use the following tags

Github

gist @ github: https://gist.github.com/cybeaer/55415ab742a2766364a52435a8859c3d

Source

mtg card tag syntax:

1
{% mtgcard "cardname" [edition] [tooltip] %}

mtg card list syntax:

1
2
3
4
5
6
{% mtglist [tooltip:true,false] [symbols:true,false] %}
count#edition#cardname;
//sideboard
count#edition#cardname;
....
{% endmtglist %}

Examples

1
2
{% mtgcard "Black Lotus" "leb"%}  
The card {% mtgcard "Black Lotus" "leb" "tooltip" %} is worth much money

The card Black Lotus is worth much money

1
2
3
4
5
6
7
{% mtglist tooltip:true download:true symbols:true %}  
1#vma#Black Lotus;
2#e02#Time Warp
//sideboard
20#bro#Swamp;
2#e02#Time Warp
{% endmtglist %}

#js #hexo #mtg #development