Class: Jekyll::Steem::SteemTag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/jekyll-steem/steem_tag.rb

Overview

Use the tag as follows in your Jekyll pages, posts and collections:

{% steem author/permlink %}

Instance Method Summary collapse

Instance Method Details

#render(context) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/jekyll-steem/steem_tag.rb', line 16

def render(context)
  @encoding = context.registers[:site].config['encoding'] || 'utf-8'
  @settings = context.registers[:site].config['steem']
  
  if (tag_contents = determine_arguments(@markup.strip))
    steem_slug = tag_contents[0]
    
    steem_tag(steem_slug)
  else
    raise ArgumentError, <<~ERROR
      Syntax error in tag 'steem' while parsing the following markup:
       #{@markup}
       Valid syntax:
        {% steem author/permlink %}

    ERROR
  end
end