class Zenweb::MonthlyPage

Generates a virtual page with monthly index pages. You must subclass and provide a content method.

Public Class Methods

generate_all(site, dir, pages) click to toggle source
# File lib/zenweb/page.rb, line 630
def self.generate_all site, dir, pages
  pages.find_all(&:dated?).group_by { |page|
    [page.date.year, page.date.month]
  }.each do |(year, month), subpages|
    path = "#{dir}/%4d/%02d/index.html.md.erb" % [year, month]
    self.new site, path, subpages, year, month
  end
end
new(site, path, pages, year, month) click to toggle source
Calls superclass method Zenweb::GeneratedIndex::new
# File lib/zenweb/page.rb, line 639
def initialize site, path, pages, year, month
  super site, path, pages
  self.date = Time.local(year, month)
  config.h['date'] = self.date
end