Sha256: a91a97aec92a84d2bf8f441e582f8d69273d0dbe9944ca487346ebba8a4b2c33
Contents?: true
Size: 526 Bytes
Versions: 13
Compression:
Stored size: 526 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
13 entries across 13 versions & 1 rubygems