diff --git a/lib/jekyll/related_posts.rb b/lib/jekyll/related_posts.rb index be0513fc..041ee551 100644 --- a/lib/jekyll/related_posts.rb +++ b/lib/jekyll/related_posts.rb @@ -46,8 +46,7 @@ module Jekyll end def most_recent_posts - recent_posts = site.posts.reverse - [post] - recent_posts.first(10) + @most_recent_posts ||= (site.posts.reverse - [post]).first(10) end def display(output)