Skip to content

Commit 302a9fc

Browse files
committed
Change @posts.docs conditional to Jekyll version check
1 parent 495ef66 commit 302a9fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/jekyll-archives.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def years
125125
hash = Hash.new { |h, key| h[key] = [] }
126126

127127
# In Jekyll 3, Collection#each should be called on the #docs array directly.
128-
if defined? @posts.docs
128+
if Jekyll::VERSION >= '3.0.0'
129129
@posts.docs.each { |p| hash[p.date.strftime("%Y")] << p }
130130
else
131131
@posts.each { |p| hash[p.date.strftime("%Y")] << p }

0 commit comments

Comments
 (0)