class Middleman::Galley::Helper

Constants

IMG

Attributes

a[R]

Public Class Methods

new(context) click to toggle source
# File lib/middleman/galley/helper.rb, line 6
def initialize context
  @a = context
end

Public Instance Methods

images(gallery_template = :default) click to toggle source

to extract as a partial?…

# File lib/middleman/galley/helper.rb, line 20
def images gallery_template = :default
  if gallery_template == :default
    gallery_template = a.galley!
                        .options.view
  end
  Template[gallery_template].build a
end
nested() click to toggle source

to extract as a partial?…

# File lib/middleman/galley/helper.rb, line 12
def nested
  a.current_page.children.select { |x| nested? x }
   .sort_by { |x| name x }
   .map { |x| link x }
   .join
end

Private Instance Methods

image?(res) click to toggle source
# File lib/middleman/galley/helper.rb, line 31
def image? res
  res.source_file =~ IMG
end
name(res) click to toggle source
# File lib/middleman/galley/helper.rb, line 38
def name res
  Pathname(res.url).basename.to_s
end
nested?(res) click to toggle source
# File lib/middleman/galley/helper.rb, line 34
def nested? res
  res.path =~ /\/index\.html$/
end