We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
@posts.docs
1 parent 495ef66 commit 302a9fcCopy full SHA for 302a9fc
lib/jekyll-archives.rb
@@ -125,7 +125,7 @@ def years
125
hash = Hash.new { |h, key| h[key] = [] }
126
127
# In Jekyll 3, Collection#each should be called on the #docs array directly.
128
- if defined? @posts.docs
+ if Jekyll::VERSION >= '3.0.0'
129
@posts.docs.each { |p| hash[p.date.strftime("%Y")] << p }
130
else
131
@posts.each { |p| hash[p.date.strftime("%Y")] << p }
0 commit comments