Class: Jekyll::Avatar
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::Avatar
- 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.0'.freeze
Instance Method Summary collapse
-
#initialize(_tag_name, text, _tokens) ⇒ Avatar
constructor
A new instance of Avatar.
- #render(context) ⇒ Object
Constructor Details
#initialize(_tag_name, text, _tokens) ⇒ Avatar
Returns a new instance of Avatar.
7 8 9 10 |
# File 'lib/jekyll-avatar.rb', line 7 def initialize(_tag_name, text, _tokens) super @text = text end |
Instance Method Details
#render(context) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/jekyll-avatar.rb', line 12 def render(context) @context = context @text = Liquid::Template.parse(@text).render(@context) attrs = attributes.map { |k, v| "#{k}=\"#{v}\"" }.join(' ') "<img #{attrs} />" end |