Sha256: b9de71348af2b1766fffbb390eb6106578c161d7b1e089a92674b3182cf2f456
Contents?: true
Size: 497 Bytes
Versions: 63
Compression:
Stored size: 497 Bytes
Contents
module Jekyll module LiquidExtensions # Lookup a Liquid variable in the given context. # # context - the Liquid context in question. # variable - the variable name, as a string. # # Returns the value of the variable in the context # or the variable name if not found. def lookup_variable(context, variable) lookup = context variable.split(".").each do |value| lookup = lookup[value] end lookup || variable end end end
Version data entries
63 entries across 63 versions & 3 rubygems