Skip to content

Commit

Permalink
Merge pull request #5822 from joelmeyerhamme/patch-1
Browse files Browse the repository at this point in the history
Merge pull request 5822
  • Loading branch information
jekyllbot committed Jan 26, 2017
2 parents e56d809 + 4b19e93 commit 2748289
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions lib/jekyll/related_posts.rb
Expand Up @@ -26,15 +26,15 @@ def build
def build_index
self.class.lsi ||= begin
lsi = ClassifierReborn::LSI.new(:auto_rebuild => false)
display("Populating LSI...")
Jekyll.logger.info("Populating LSI...")

site.posts.docs.each do |x|
lsi.add_item(x)
end

display("Rebuilding index...")
Jekyll.logger.info("Rebuilding index...")
lsi.build_index
display("")
Jekyll.logger.info("")
lsi
end
end
Expand All @@ -46,11 +46,5 @@ def lsi_related_posts
def most_recent_posts
@most_recent_posts ||= (site.posts.docs.reverse - [post]).first(10)
end

def display(output)
$stdout.print("\n")
$stdout.print(Jekyll.logger.formatted_topic(output))
$stdout.flush
end
end
end

0 comments on commit 2748289

Please sign in to comment.