Skip to content

Instantly share code, notes, and snippets.

@nlindley
nlindley / archivepage.rb
Last active December 30, 2015 04:18 — forked from ilkka/archivepage.rb
module Jekyll
class ArchivePage < Page
include Convertible
attr_accessor :site, :pager, :name, :ext, :basename, :dir, :data, :content, :output
# Initialize new ArchivePage
# +site+ is the Site
# +month+ is the month
# +posts+ is the list of posts for the month
module Jekyll
class ArchiveGenerator < Generator
safe true
def generate(site)
collate_by_month(site.posts).each do |month, posts|
page = ArchivePage.new(site, month, posts)
site.pages << page
end
end