Class: Jekyll::Avatar

Inherits:
Liquid::Tag show all
Defined in:
lib/jekyll-avatar.rb,
lib/jekyll-avatar/version.rb

Constant Summary collapse

SERVERS =
4
DEFAULT_SIZE =
40
API_VERSION =
3
VERSION =
'0.4.1'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(_tag_name, text, _tokens) ⇒ Avatar

Returns a new instance of Avatar.



9
10
11
12
# File 'lib/jekyll-avatar.rb', line 9

def initialize(_tag_name, text, _tokens)
  super
  @text = text
end

Instance Method Details

#render(context) ⇒ Object



14
15
16
17
18
19
# File 'lib/jekyll-avatar.rb', line 14

def render(context)
  @context = context
  @text    = Liquid::Template.parse(@text).render(@context)
  attrs    = attributes.map { |k, v| "#{k}=\"#{v}\"" }.join(' ')
  "<img #{attrs} />"
end