engine/lib/locomotive/liquid/drops/javascripts.rb

18 lines
392 B
Ruby
Raw Normal View History

2010-06-03 15:32:40 +00:00
module Locomotive
module Liquid
module Drops
class Javascripts < ::Liquid::Drop
def initialize(site)
@site = site
end
def before_method(meth)
asset = site.theme_assets.where(:content_type => 'javascript', :slug => meth.to_s).first
!asset.nil? ? asset.source.url : nil
end
end
end
end
end