Class: BridgetownSvgInliner::Builder

Inherits:
Bridgetown::Builder
  • Object
show all
Defined in:
lib/bridgetown-svg-inliner/builder.rb

Instance Method Summary collapse

Instance Method Details

#buildObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/bridgetown-svg-inliner/builder.rb', line 5

def build
  liquid_tag "svg" do |attributes, tag|
    attributes = Liquid::Template.parse(attributes).render(tag.context)
    attributes = LiquidAttributes.new(attributes)

    render attributes.path, attributes.args
  end

  helper "svg" do |path, attributes|
    render path, attributes
  end
end