in source/_plugins/generate_archives.rb [124:141]
def write_archive_indexes
if self.layouts.key? 'archive_index'
dir = self.config['archive_dir'] || 'archives'
posts_by_year_month = self.posts.docs.inject({}) do |h, post|
((h[post.date.year] ||= {})[sprintf('%02i', post.date.month)] ||= []) << post
h
end.each do |year, months|
months.each do |month, posts|
self.write_archive_index(File.join(dir, year.to_s, month.to_s), posts.reverse, year, month)
end
end
else
throw "No 'archive_index' layout found."
end
end