class Zenweb::GeneratedIndex

Generates a virtual page with an index of all tags on the given pages. You must subclass and provide a content method.

Attributes

pages[RW]

Public Class Methods

collate_by(pages, key, default=nil) click to toggle source
# File lib/zenweb/page.rb, line 514
def self.collate_by pages, key, default=nil
  pages.multi_group_by { |page| page.config[key] || default }
end
generate_all(site, dir, pages) click to toggle source
# File lib/zenweb/page.rb, line 518
def self.generate_all site, dir, pages
  raise NotImplementedError, "Implement #{self}#generate_all"
end
new(site, path, pages) click to toggle source
Calls superclass method
# File lib/zenweb/page.rb, line 526
def initialize site, path, pages
  super site, path

  self.pages = pages.select(&:html?)
  self.date  = Time.now

  site.pages[path] = self
end
page_url(page) click to toggle source
# File lib/zenweb/page.rb, line 522
def self.page_url page # TODO: hard to do helpers on class methods
  "[#{page.title}](#{page.clean_url})"
end

Public Instance Methods

content() click to toggle source
# File lib/zenweb/page.rb, line 535
def content
  raise NotImplementedError, "Implement #{self.class}#content"
end
wire() click to toggle source
Calls superclass method Zenweb::Page#wire
# File lib/zenweb/page.rb, line 539
def wire
  super
  self.depends_on pages
end