1.9.3. 常用过滤器 (up)

1.9.3.1. group_by 过滤器

按一些关键 示例分组集合: 按服务分组应用程序

{% assign grouped = applications | group_by: 'service' %}
{% for group in grouped %}
  Service: {{ group[0 }}
  {% for app in group[1] %}
    Application: {{ app.name }}
  {% endfor %}
{% endfor %}