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:
parent
f5c727fadb
commit
c31d676f0f
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue