Sha256: 55ac3d600328593573f63888e2531f94398aa4bd07889143c31bb650244ab491

Contents?: true

Size: 525 Bytes

Versions: 9

Compression:

Stored size: 525 Bytes

Contents

def partial(template, *args)
  options = args.last.is_a?(Hash) ? args.pop : { }
  options.merge!(:layout => false)
  if collection = options.delete(:collection) then
      haml_concat(collection.inject([]) do |buffer, member|
        buffer << haml(template, options.merge(
                                :layout => false,
                                :locals => {template.to_sym => member}
                              )
                   )
    end.join("\n"))
  else
    haml_concat(haml(template, options))
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
beans-middleman-1.0.14 lib/middleman/features/partials.rb
beans-middleman-1.0.13 lib/middleman/features/partials.rb
beans-middleman-1.0.12 lib/middleman/features/partials.rb
beans-middleman-1.0.11 lib/middleman/features/partials.rb
beans-middleman-1.0.9 lib/middleman/features/partials.rb
beans-middleman-1.0.8 lib/middleman/features/partials.rb
beans-middleman-1.0.7 lib/middleman/features/partials.rb
beans-middleman-1.0.6 lib/middleman/features/partials.rb
beans-middleman-1.0.5 lib/middleman/features/partials.rb