Class: JekyllIndexPages::Archive

Inherits:
Jekyll::Generator
  • Object
show all
Defined in:
lib/jekyll-index-pages/archive.rb

Instance Method Summary collapse

Instance Method Details

#generate(site) ⇒ Object



5
6
7
8
9
# File 'lib/jekyll-index-pages/archive.rb', line 5

def generate(site)
  archive = Hash.new { |hash, key| hash[key] = [] }
  site.posts.docs.each { |doc| archive[doc.date.strftime("%Y")] << doc }
  site.data["archive"] = archive
end