class Jekyll::Tags::IconTagVar
The variable version that can accept a variable name instead of a string
Public Class Methods
Calls superclass method
Jekyll::Tags::IconTag::new
# File _plugins/jekyll-icon-tag.rb, line 76 def initialize(tag_name, text, tokens) super @text = text.strip end
Public Instance Methods
icon_var - Include an icon from our _config.yml into your tutorial, but accessing a variable rather than expecting a string.
Examples:
{% icon_var var1 %} {% icon_var var2 %}
# File _plugins/jekyll-icon-tag.rb, line 89 def render(context) cfg = get_config(context) icon = cfg[context[@text]] || '' render_for_text(icon) end