Sha256: 248ce6278b167f5a4e06109be149dd3b0123be187148930e981afd7c13e9a80f
Contents?: true
Size: 528 Bytes
Versions: 28
Compression:
Stored size: 528 Bytes
Contents
# frozen_string_literal: true 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
28 entries across 28 versions & 2 rubygems