1 class Layout < Erector::Widget
4 def inherited(page_class)
6 (@@page_classes ||= []) << page_class
10 @@page_classes.each do |page_class|
11 page_class.generate_html unless page_class.abstract?
17 File.open(absolute_path, 'w') do |file|
18 file.write(new.render)
23 absolutize(relative_path)
27 "#{name.gsub('::', '_').underscore}.html"
30 def absolutize(relative_path)
31 File.join(File.dirname(__FILE__), "site", relative_path)
43 def bluecloth(relative_path)
44 File.open(File.join(File.dirname(__FILE__), relative_path)) do |file|
45 rawtext BlueCloth.new(file.read).to_html
49 def absolutize(relative_path)
50 self.class.absolutize(relative_path)
53 def link_to(link_text, page_class, section_class=nil)
54 if instance_of?(page_class) || section_class && is_a?(section_class)
57 a link_text, :href => page_class.relative_path