From cc83501489c41c96b35ea26b55f7df31faf65dee Mon Sep 17 00:00:00 2001 From: Daniel Hilgarth Date: Sun, 3 Mar 2013 14:56:18 +0100 Subject: [PATCH] Fix broken post_url with posts with a time in their YAML front matter. --- lib/jekyll/post.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index b8d0ad55..c2d70199 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -79,12 +79,15 @@ module Jekyll # Compares Post objects. First compares the Post date. If the dates are # equal, it compares the Post slugs. + # This comparison is used to create internal links using post_url. + # Post filenames are without a time, but the date property in the YAML + # front matter can be with time, so we compare only the date here. # # other - The other Post we are comparing to. # # Returns -1, 0, 1 def <=>(other) - cmp = self.date <=> other.date + cmp = self.date.to_date <=> other.date.to_date if 0 == cmp cmp = self.slug <=> other.slug end