mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-30 17:28:29 -05:00
Convertible#to_liquid: allow an alternate attribute set to be passed
This commit is contained in:
@@ -87,8 +87,8 @@ module Jekyll
|
||||
# Convert this Convertible's data to a Hash suitable for use by Liquid.
|
||||
#
|
||||
# Returns the Hash representation of this Convertible.
|
||||
def to_liquid
|
||||
further_data = Hash[self.class::ATTRIBUTES_FOR_LIQUID.map { |attribute|
|
||||
def to_liquid(attrs = nil)
|
||||
further_data = Hash[(attrs || self.class::ATTRIBUTES_FOR_LIQUID).map { |attribute|
|
||||
[attribute, send(attribute)]
|
||||
}]
|
||||
data.deep_merge(further_data)
|
||||
|
||||
Reference in New Issue
Block a user