Merge pull request #2493 from jekyll/fix-sort

This commit is contained in:
Parker Moore 2014-06-23 19:02:54 -04:00
commit d359c63018
1 changed files with 5 additions and 4 deletions

View File

@ -207,9 +207,8 @@ module Jekyll
when nils == "last"
order = + 1
else
Jekyll.logger.error "Invalid nils order:",
"'#{nils}' is not a valid nils order. It must be 'first' or 'last'."
exit(1)
raise ArgumentError.new("Invalid nils order: " +
"'#{nils}' is not a valid nils order. It must be 'first' or 'last'.")
end
input.sort { |apple, orange|
@ -247,7 +246,9 @@ module Jekyll
end
def item_property(item, property)
if item.respond_to?(:data)
if item.respond_to?(:to_liquid)
item.to_liquid[property.to_s]
elsif item.respond_to?(:data)
item.data[property.to_s]
else
item[property.to_s]