-
Notifications
You must be signed in to change notification settings - Fork 109
/
person-list
26 lines (25 loc) · 898 Bytes
/
person-list
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{%- assign people = include.ids | split: "|" -%}
{%- assign limit = include.limit | default: 3 -%}
{%- if people.size > limit -%}
{%- comment -%} Conceal the overflow beneath a details box. {%- endcomment -%}
<details class="person-list">
<summary>
{%- for person in people limit:limit -%}
{%- assign id = person | strip -%}
{%- include person id=id -%}{%- if forloop.last -%}...{%- else -%}, {% endif -%}
{%- endfor -%}
</summary>
{%- for person in people offset:limit -%}
{%- assign id = person | strip -%}
{%- include person id=id -%}{%- unless forloop.last -%}, {% endunless -%}
{%- endfor -%}
</details>
{%- else -%}
{%- for person in people -%}
{%- assign id = person | strip -%}
{%- include person id=id -%}{%- unless forloop.last -%}, {% endunless -%}
{%- endfor -%}
{%- endif -%}
{%- comment -%}
# vi:syntax=liquid
{%- endcomment -%}