Class: JekyllAssetPostProcessor::ProcessAssetTag

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/liquid/process_asset_tag.rb

Instance Method Summary collapse

Constructor Details

#initialize(tag_name, args, token) ⇒ ProcessAssetTag

Returns a new instance of ProcessAssetTag.



4
5
6
7
# File 'lib/liquid/process_asset_tag.rb', line 4

def initialize(tag_name, args, token)
    super
    @args = args.strip
end

Instance Method Details

#render(context) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/liquid/process_asset_tag.rb', line 9

def render(context)
    template = Liquid::Template.parse(@args)
    stylesheet_path = template.render(context)
    
    if stylesheet_path.length == 0
        raise 'No asset given to process'
    end

    JekyllAssetPostProcessor::process(context, stylesheet_path)
end