Making it easier to work with hashes, Mechanic's Liquid implementation now includes two new filters:
  • "keys" – returns an array of the hash's keys
  • "values" – returns an array of the hash's values
{% assign foo = hash %}
{% assign foo["bar"] = "baz" %}
{% assign foo["qux"] = "quux" %}
{{ foo | keys | join: ", " }}
{{ foo | values | join: ", " }}
=> "bar, qux"
=> "baz, quux"
Read more