Add {{ | jsonify }} support for hashes.
This commit is contained in:
parent
774c65a869
commit
9a15a09028
|
@ -328,10 +328,14 @@ module Jekyll
|
|||
|
||||
def as_liquid(item)
|
||||
case item
|
||||
when String, Numeric, nil
|
||||
item.to_liquid
|
||||
when Hash
|
||||
Hash[item.map { |k, v| [as_liquid(k), as_liquid(v)] }]
|
||||
when Array
|
||||
item.map{ |i| as_liquid(i) }
|
||||
else
|
||||
item.respond_to?(:to_liquid) ? item.to_liquid : item
|
||||
item.respond_to?(:to_liquid) ? as_liquid(item.to_liquid) : item
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue