From dd268fae95d1d7785fa3878f8fc62110e2c40d7c Mon Sep 17 00:00:00 2001 From: Thomas Jack Date: Wed, 22 Apr 2009 20:51:49 -0500 Subject: [PATCH] sort posts before rendering so next and previous posts work Signed-off-by: Nick Quaranto --- lib/jekyll/site.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb index eaba3d48..622f49ca 100644 --- a/lib/jekyll/site.rb +++ b/lib/jekyll/site.rb @@ -130,12 +130,13 @@ module Jekyll end end + self.posts.sort! + # second pass renders each post now that full site payload is available self.posts.each do |post| post.render(self.layouts, site_payload) end - self.posts.sort! self.categories.values.map { |cats| cats.sort! { |a, b| b <=> a} } rescue Errno::ENOENT => e # ignore missing layout dir