Sha256: e11c2d5c66994eb73c11ae65fede99013a767cd560c0d936c0f8d19ffa162628

Contents?: true

Size: 666 Bytes

Versions: 48

Compression:

Stored size: 666 Bytes

Contents

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

      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
  end
end

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
middleman-2.0.0.beta6 lib/middleman/features/asset_host.rb
middleman-2.0.0.beta5 lib/middleman/features/asset_host.rb
middleman-2.0.0.beta4 lib/middleman/features/asset_host.rb
beans-middleman-1.0.14 lib/middleman/features/asset_host.rb
middleman-2.0.0.beta3 lib/middleman/features/asset_host.rb
beans-middleman-1.0.13 lib/middleman/features/asset_host.rb
beans-middleman-1.0.12 lib/middleman/features/asset_host.rb
beans-middleman-1.0.11 lib/middleman/features/asset_host.rb
middleman-1.2.8 lib/middleman/features/asset_host.rb
middleman-2.0.0.beta2 lib/middleman/features/asset_host.rb
middleman-1.2.7 lib/middleman/features/asset_host.rb
middleman-1.2.6 lib/middleman/features/asset_host.rb
middleman-1.2.5 lib/middleman/features/asset_host.rb
middleman-1.2.4 lib/middleman/features/asset_host.rb
middleman-1.2.3 lib/middleman/features/asset_host.rb
middleman-1.2.2 lib/middleman/features/asset_host.rb
middleman-1.2.1 lib/middleman/features/asset_host.rb
beans-middleman-1.0.9 lib/middleman/features/asset_host.rb
middleman-1.2.0 lib/middleman/features/asset_host.rb
middleman-1.1.6 lib/middleman/features/asset_host.rb