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



78
79
80
81
82
# File 'lib/jekyll-theme-amethyst.rb', line 78

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