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