Merge pull request #2729 from jekyll/to_liquid_before_jsonify

This commit is contained in:
Parker Moore 2014-08-12 11:18:30 -04:00
commit 7b9d392d6f
1 changed files with 5 additions and 1 deletions

View File

@ -155,7 +155,7 @@ module Jekyll
# #
# Returns the converted json string # Returns the converted json string
def jsonify(input) def jsonify(input)
input.to_json as_liquid(input).to_json
end end
# Group an array of items by a property # Group an array of items by a property
@ -254,5 +254,9 @@ module Jekyll
item[property.to_s] item[property.to_s]
end end
end end
def as_liquid(item)
item.respond_to?(:to_liquid) ? item.to_liquid : item
end
end end
end end