mirror of
https://github.com/kemko/liquid.git
synced 2026-01-01 15:55:40 +03:00
762 B
762 B
title, description
| title | description |
|---|---|
| map | Liquid filter that creates an array of values by extracting a named property from an object. |
Creates an array of values by extracting the values of a named property from another object.
In this example, assume the object site.pages contains all the metadata for a website. Using assign with the map filter creates a variable that contains only the values of the category properties of everything in the site.pages object.
Input
```liquid {%- raw -%} {% assign all_categories = site.pages | map: "category" %}{% for item in all_categories %}
- {{ item }} {% endfor %} {% endraw %}
<p class="code-label">Output</p>
```text
- business
- celebrities
- lifestyle
- sports
- technology