mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-31 01:38:24 -05:00
Cache the related posts most_recent_posts
/cc @mattr- is this safe to do, you think? it only happens at render time...
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user