Sha256: 6842dbcf62f0b7fc65f32e5643b6f23bcf7d981f35b4835b962ede049506a7d0
Contents?: true
Size: 650 Bytes
Versions: 7
Compression:
Stored size: 650 Bytes
Contents
require 'jekyll/fontawesome/svg/fa-icon' module Jekyll module FontAwesome module Svg class FontAwesomeSvgItemGenerator < Liquid::Tag def initialize(tag_name, faIcon, tokens) super @icon = FontAwesomeIcon.new(faIcon.strip) end def render(context) 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>" end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems