From 0918bc958493c77bd68f73cec5554528bf271837 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Wed, 17 Apr 2019 19:21:49 +0530 Subject: [PATCH] Remove support for legacy Jekyll versions --- lib/jekyll-archives.rb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/jekyll-archives.rb b/lib/jekyll-archives.rb index b67ade7..437321e 100644 --- a/lib/jekyll-archives.rb +++ b/lib/jekyll-archives.rb @@ -93,13 +93,7 @@ def categories # Custom `post_attr_hash` method for years def years hash = Hash.new { |h, key| h[key] = [] } - - # In Jekyll 3, Collection#each should be called on the #docs array directly. - if Jekyll::VERSION >= "3.0.0" - @posts.docs.each { |p| hash[p.date.strftime("%Y")] << p } - else - @posts.each { |p| hash[p.date.strftime("%Y")] << p } - end + @posts.docs.each { |p| hash[p.date.strftime("%Y")] << p } hash.each_value { |posts| posts.sort!.reverse! } hash end