class Zenweb::YearlyPage
Generates a virtual page with yearly 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 651 def self.generate_all site, dir, pages pages.find_all(&:dated?).group_by { |page| page.date.year }.each do |year, subpages| path = "#{dir}/%4d/index.html.md.erb" % [year] self.new site, path, subpages, year end end
new(site, path, pages, year)
click to toggle source
Calls superclass method
Zenweb::GeneratedIndex::new
# File lib/zenweb/page.rb, line 660 def initialize site, path, pages, year super site, path, pages self.date = Time.local(year) config.h['date'] = self.date end