Class: ImageGallery::GalleryIndexPage

Inherits:
Jekyll::Page
  • Object
show all
Defined in:
lib/gallery/gallery.rb

Instance Method Summary collapse

Constructor Details

#initialize(site, year, galleries, override_dir: nil) ⇒ GalleryIndexPage

Returns a new instance of GalleryIndexPage.



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
# File 'lib/gallery/gallery.rb', line 247

def initialize(site, year, galleries, override_dir: nil)
  @site = site
  @base = site.source
  @dir = override_dir || File.join(*ImageGallery.gallery_path_array(site, year))

  @basename = 'index'
  @ext = '.html'
  @name = "#{@basename}#{@ext}"

  config = ImageGallery._config_with_defaults(site)
  @data = {
    'layout' => 'gallery_index',
    'year' => year,
    'galleries' => galleries,
    'title' => [config['title_prefix'], year].join(" #{config['title_seperator']} "),
  }

  data.default_proc = proc do |_, key|
    site.frontmatter_defaults.find(relative_path, :gallery_indexes, key)
  end
end