Class: Aardi::Blog

Inherits:
AbstractBlog show all
Defined in:
lib/aardi/blog.rb

Instance Attribute Summary

Attributes inherited from AbstractBlog

#key

Instance Method Summary collapse

Methods inherited from AbstractBlog

#metadata, #mtime, #render

Constructor Details

#initialize(posts_path, archive_path) ⇒ Blog

Returns a new instance of Blog.



5
6
7
8
# File 'lib/aardi/blog.rb', line 5

def initialize(posts_path, archive_path)
  @posts_path = posts_path
  @archive_path = archive_path
end

Instance Method Details

#postsObject



10
11
12
# File 'lib/aardi/blog.rb', line 10

def posts
  @posts ||= Dir.glob("#{@posts_path}/**/*.md").map { |post_path| Post.new(post_path) }.sort_by(&:creation)
end

#report_recentObject



14
15
16
# File 'lib/aardi/blog.rb', line 14

def report_recent
  recent_posts(:blog_recent_posts).each(&:report_field_summary)
end