1
0
Fork 0
mirror of https://github.com/middleman/middleman.git synced 2022-11-09 12:20:27 -05:00
middleman--middleman/lib/middleman/features/asset_host.rb

22 lines
666 B
Ruby
Raw Normal View History

module Middleman::Features::AssetHost
class << self
def registered(app)
app.after_feature_init do
if Middleman::Server.asset_host.is_a?(Proc)
::Compass.configuration.asset_host(&Middleman::Server.asset_host)
end
end
2010-02-02 20:03:43 -05:00
Middleman::Assets.register :asset_host do |path, prefix, request|
original_output = Middleman::Assets.before(:asset_host, path, prefix, request)
valid_extensions = %w(.png .gif .jpg .jpeg .js .css)
asset_prefix = Middleman::Server.asset_host.call(original_output)
File.join(asset_prefix, original_output)
end
end
alias :included :registered
2010-02-02 20:03:43 -05:00
end
end