Class: Zenweb::SeriesPage

Inherits:
GeneratedIndex show all
Defined in:
lib/zenweb/page.rb

Constant Summary

Constants inherited from Page

Page::KRAMDOWN_CONFIG

Instance Attribute Summary collapse

Attributes inherited from GeneratedIndex

#pages

Attributes inherited from FakePage

#content, #date

Attributes inherited from Page

#binary, #parent, #path, #site, #subpages

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from GeneratedIndex

collate_by, #content, page_url, #wire

Methods inherited from Page

#[], #all_subpages, #all_subpages_by_level, #analytics, #body, #breadcrumbs, #change_frequency, #clean_url, #config, #content, #date, #date_from_path, #date_str, #dated?, #dated_path?, #depends_on, #disqus, #disqus_counts, #erb, #extend_md, #filetype, #filetypes, #format_date, #gauges_analytics, #generate, #google_ad, #google_analytics, #html?, #include, #index?, #inspect, #layout, #link_head, #link_html, #markdown, #meta, #method_missing, #no_index?, #parent_url, #render, #render_erb, #render_less, #render_md, renderers_re, #run_js_script, #series_page, #stale?, #stylesheet, #subrender, #tag_pages, #url, #url_dir, #url_path, #wire

Constructor Details

#initialize(site, path, pages, series) ⇒ SeriesPage

Returns a new instance of SeriesPage.



619
620
621
622
# File 'lib/zenweb/page.rb', line 619

def initialize site, path, pages, series
  super site, path, pages
  self.series = series
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Zenweb::Page

Instance Attribute Details

#seriesObject

Returns the value of attribute series.



600
601
602
# File 'lib/zenweb/page.rb', line 600

def series
  @series
end

Class Method Details

.allObject



602
603
604
# File 'lib/zenweb/page.rb', line 602

def self.all
  @@all ||= {}
end

.generate_all(site, dir, pages) ⇒ Object



610
611
612
613
614
615
616
617
# File 'lib/zenweb/page.rb', line 610

def self.generate_all site, dir, pages
  series_for(pages).sort.each do |series, pgs|
    next unless series
    path = series.downcase.gsub(/\W/, '-')
    path = "#{dir}/#{path}.html.md.erb"
    self.all[series] = self.new(site, path, pgs, series)
  end
end

.series_for(pages) ⇒ Object



606
607
608
# File 'lib/zenweb/page.rb', line 606

def self.series_for pages
  collate_by pages, :series
end