Convertible#to_liquid: allow an alternate attribute set to be passed
This commit is contained in:
parent
6c6dd173c7
commit
01922a10ac
|
@ -87,8 +87,8 @@ module Jekyll
|
||||||
# Convert this Convertible's data to a Hash suitable for use by Liquid.
|
# Convert this Convertible's data to a Hash suitable for use by Liquid.
|
||||||
#
|
#
|
||||||
# Returns the Hash representation of this Convertible.
|
# Returns the Hash representation of this Convertible.
|
||||||
def to_liquid
|
def to_liquid(attrs = nil)
|
||||||
further_data = Hash[self.class::ATTRIBUTES_FOR_LIQUID.map { |attribute|
|
further_data = Hash[(attrs || self.class::ATTRIBUTES_FOR_LIQUID).map { |attribute|
|
||||||
[attribute, send(attribute)]
|
[attribute, send(attribute)]
|
||||||
}]
|
}]
|
||||||
data.deep_merge(further_data)
|
data.deep_merge(further_data)
|
||||||
|
|
Loading…
Reference in New Issue