Class: Bunto::Assets::Processors::Liquid

Inherits:
Object
  • Object
show all
Defined in:
lib/bunto/assets/processors/liquid.rb

Constant Summary collapse

FOR =
%W(
text/css text/sass text/less application/javascript
text/scss text/coffeescript text/javascript).freeze
EXT =
%W(.liquid .js.liquid .css.liquid .scss.liquid).freeze

Class Method Summary collapse

Class Method Details

.call(context, bunto = context[:environment].bunto) ⇒ Object




12
13
14
15
16
17
18
19
20
21
22
# File 'lib/bunto/assets/processors/liquid.rb', line 12

def self.call(context, bunto = context[:environment].bunto)
  if context[:environment].parent.asset_config["features"]["liquid"] || \
      File.extname(context[:filename]) == ".liquid"

    payload_ = bunto.site_payload
    renderer = bunto.liquid_renderer.file(context[:filename])
    context[:data] = renderer.parse(context[:data]).render! payload_, :registers => {
      :site => bunto
    }
  end
end