parent
44062561f0
commit
8bb76c865f
|
@ -79,6 +79,8 @@ Metrics/MethodLength:
|
|||
Severity: error
|
||||
Metrics/ModuleLength:
|
||||
Max: 240
|
||||
Exclude:
|
||||
- lib/jekyll/filters.rb
|
||||
Metrics/ParameterLists:
|
||||
Max: 4
|
||||
Metrics/PerceivedComplexity:
|
||||
|
|
|
@ -356,15 +356,24 @@ module Jekyll
|
|||
@item_property_cache ||= {}
|
||||
@item_property_cache[property] ||= {}
|
||||
@item_property_cache[property][item] ||= begin
|
||||
if item.respond_to?(:to_liquid)
|
||||
property.to_s.split(".").reduce(item.to_liquid) do |subvalue, attribute|
|
||||
parse_sort_input(subvalue[attribute])
|
||||
end
|
||||
property = property.to_s
|
||||
property = if item.respond_to?(:to_liquid)
|
||||
read_liquid_attribute(item.to_liquid, property)
|
||||
elsif item.respond_to?(:data)
|
||||
parse_sort_input(item.data[property.to_s])
|
||||
item.data[property]
|
||||
else
|
||||
parse_sort_input(item[property.to_s])
|
||||
item[property]
|
||||
end
|
||||
|
||||
parse_sort_input(property)
|
||||
end
|
||||
end
|
||||
|
||||
def read_liquid_attribute(liquid_data, property)
|
||||
return liquid_data[property] unless property.include?(".")
|
||||
|
||||
property.split(".").reduce(liquid_data) do |data, key|
|
||||
data.respond_to?(:[]) && data[key]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue