diff --git a/lib/jekyll/filters.rb b/lib/jekyll/filters.rb index 3ee63188..002d926f 100644 --- a/lib/jekyll/filters.rb +++ b/lib/jekyll/filters.rb @@ -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]