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:
parent
817f6cb658
commit
656e772388
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue