lib/jekyll/fontawesome/svg/fa-item.rb in jekyll-fontawesome-svg-0.3.3 vs lib/jekyll/fontawesome/svg/fa-item.rb in jekyll-fontawesome-svg-0.3.4
- old
+ new
@@ -2,15 +2,18 @@
module Jekyll
module FontAwesome
module Svg
class FontAwesomeSvgItemGenerator < Liquid::Tag
- def initialize(tag_name, faIcon, tokens)
+ def initialize(tag_name, markup, tokens)
super
- @icon = FontAwesomeIcon.new(faIcon.strip)
+ @tmp_markup = markup
end
def render(context)
+ faIcon = context[@markup] ||= @tmp_markup
+ @icon = FontAwesomeIcon.new(faIcon.strip)
+
unless context.environments.first['page']['fa_svg'].is_a?([]::class)
context.environments.first['page']['fa_svg'] = []
end
context.environments.first['page']['fa_svg'].push(@icon.value)
"<svg class=\"icon\"><use xlink:href='##{@icon.value}'></use></svg>"
\ No newline at end of file