Class: WhoNeedsWP::Page
- Defined in:
- lib/who-needs-wp/content/Page.rb
Constant Summary collapse
- @@pages =
A list of all the pages on the site
[]
Instance Attribute Summary
Attributes inherited from Content
#author, #filename, #html, #id, #markdown, #summary, #tags, #tiny_url, #title, #url
Class Method Summary collapse
-
.all ⇒ Object
Return all the pages created.
-
.load ⇒ Object
Load all pages.
-
.render_all ⇒ Object
Render all the pages loaded.
Instance Method Summary collapse
-
#render ⇒ Object
See Content.render_content.
Methods inherited from Content
Constructor Details
This class inherits a constructor from WhoNeedsWP::Content
Class Method Details
.all ⇒ Object
Return all the pages created
30 31 32 |
# File 'lib/who-needs-wp/content/Page.rb', line 30 def self.all return @@pages end |
.load ⇒ Object
Load all pages
6 7 8 9 10 11 |
# File 'lib/who-needs-wp/content/Page.rb', line 6 def self.load Dir.glob('pages/*.markdown').each do |filename| @@pages << Page.new(filename) end @@pages.sort! { |a, b| a.title <=> b.title } end |
.render_all ⇒ Object
Render all the pages loaded
23 24 25 26 27 |
# File 'lib/who-needs-wp/content/Page.rb', line 23 def self.render_all @@pages.each do |page| page.render end end |
Instance Method Details
#render ⇒ Object
See Content.render_content
14 15 16 17 18 19 20 |
# File 'lib/who-needs-wp/content/Page.rb', line 14 def render @html = WhoNeedsWP::render_template("page", { :page => self, :title => @title }) super() end |