mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-06 03:01:43 -04:00
skipping related_posts when there is only one post.
Without this the Matrix class raises an error trying to coerce nil into a Matrix.
This commit is contained in:
@@ -96,6 +96,7 @@ module Jekyll
|
||||
#
|
||||
# Returns [<Post>]
|
||||
def related_posts(posts)
|
||||
return [] unless posts.size > 1
|
||||
self.class.lsi ||= begin
|
||||
puts "Running the classifier... this could take a while."
|
||||
lsi = Classifier::LSI.new
|
||||
@@ -145,4 +146,4 @@ module Jekyll
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user