From f826b8b5eab9bdce08868c5e09de87a02dd536a4 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Thu, 12 Mar 2020 20:28:17 +0530 Subject: [PATCH] Fix documents custom-ordering logic (#8028) Merge pull request 8028 --- lib/jekyll/collection.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/jekyll/collection.rb b/lib/jekyll/collection.rb index 874d26f2215..318642151a1 100644 --- a/lib/jekyll/collection.rb +++ b/lib/jekyll/collection.rb @@ -239,7 +239,7 @@ def sort_docs_by_key! # Fall back to `Document#<=>` if the properties were equal or were non-sortable # Otherwise continue with current sort-order - if order.zero? || order.nil? + if order.nil? || order.zero? apples[-1] <=> olives[-1] else order