Class: Aardi::Blog
Instance Attribute Summary
Attributes inherited from AbstractBlog
#key
Instance Method Summary
collapse
#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
#posts ⇒ Object
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_recent ⇒ Object
14
15
16
|
# File 'lib/aardi/blog.rb', line 14
def report_recent
recent_posts(:blog_recent_posts).each(&:report_field_summary)
end
|