module Jekyll::Utils
def pluralized_array_from_hash(hash, singular_key, plural_key)
plural_key - the plural key
singular_key - the singular key
hash - the hash to read from
and then the plural key, and handling any nil entries.
Read array from the supplied hash favouring the singular key
def pluralized_array_from_hash(hash, singular_key, plural_key) array = [] value = value_from_singular_key(hash, singular_key) value ||= value_from_plural_key(hash, plural_key) array << value array.flatten! array.compact! array end