Class: Jekyll::AmethystPlugin::YearDataGenerator

Inherits:
Generator
  • Object
show all
Defined in:
lib/jekyll-theme-amethyst.rb

Instance Method Summary collapse

Instance Method Details

#generate(site) ⇒ Object



107
108
109
110
111
# File 'lib/jekyll-theme-amethyst.rb', line 107

def generate(site)
	s = Set.new()
	site.posts&.docs&.each { |post| s.add(post.date.strftime('%Y')) }
	site.data["amethyst_post_years"] = s.to_a.sort!.reverse!
end