Class: Aardi::Home

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

Instance Attribute Summary

Attributes inherited from AbstractBlog

#key

Instance Method Summary collapse

Methods inherited from AbstractBlog

#metadata, #mtime, #title

Constructor Details

#initialize(posts, archive_path, blog_path = nil, tag = nil) ⇒ Home

Returns a new instance of Home.



5
6
7
8
9
10
# File 'lib/aardi/home.rb', line 5

def initialize(posts, archive_path, blog_path = nil, tag = nil)
  @posts = posts
  @archive_path = archive_path
  @blog_path = blog_path
  @tag = tag
end

Instance Method Details

#contentObject



12
13
14
# File 'lib/aardi/home.rb', line 12

def content
  "# #{title}\n#{post_days_content}#{}"
end

#renderObject



16
17
18
19
# File 'lib/aardi/home.rb', line 16

def render
  Aardi.renderer.sitemap.update_mtime('/', mtime) unless @blog_path
  write_target
end

#target_pathObject



21
22
23
24
25
# File 'lib/aardi/home.rb', line 21

def target_path
  return "./#{@blog_path}/index.html" if @blog_path

  './index.html'
end