Class: Jekyll::Tags::UseSvg
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::Tags::UseSvg
- Defined in:
- lib/esvg/jekyll_hooks.rb
Instance Method Summary collapse
-
#initialize(tag_name, markup, tokens) ⇒ UseSvg
constructor
A new instance of UseSvg.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, markup, tokens) ⇒ UseSvg
Returns a new instance of UseSvg.
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/esvg/jekyll_hooks.rb', line 48 def initialize(tag_name, markup, tokens) super markup.sub!(/(\S+) /) do @name = $1.gsub(/[",']/, '') '' end = markup.strip.split(/,\s*/).join("\n") if .empty? = {} else = Jekyll::Utils.symbolize_hash_keys(YAML.load()) unless .empty? end end |
Instance Method Details
#render(context) ⇒ Object
64 65 66 |
# File 'lib/esvg/jekyll_hooks.rb', line 64 def render(context) Esvg.use(@name, ) end |