Class: Aardi::Archive

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

Instance Attribute Summary

Attributes inherited from AbstractBlog

#key

Instance Method Summary collapse

Methods inherited from AbstractBlog

#metadata, #mtime, #render

Constructor Details

#initialize(posts, archive_path) ⇒ Archive

Returns a new instance of Archive.



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

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

Instance Method Details

#contentObject



10
11
12
13
14
15
# File 'lib/aardi/archive.rb', line 10

def content
  year_fmt = "| %<year>s | %<months>s \n"
  month_fmt = "[&nbsp;%<count>s&nbsp;](#{Aardi.config[:site_url]}/%<archive_path>s/%<year>s/%<month>s/)"

  "#{header}#{years.map { |year| year.archive_row(year_fmt, month_fmt) }.join}"
end

#target_pathObject



17
# File 'lib/aardi/archive.rb', line 17

def target_path = "./#{@archive_path}/index.html"

#titleObject



19
# File 'lib/aardi/archive.rb', line 19

def title = Aardi.config[:blog_archive_title]