-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathcontributor-tiles-all.html
More file actions
50 lines (50 loc) · 1.89 KB
/
contributor-tiles-all.html
File metadata and controls
50 lines (50 loc) · 1.89 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{%- assign contributors_lookup = site.data.contributors | default: site.data.CONTRIBUTORS -%}
{%- assign allcontrstr = nil %}
{%- assign nr = include.col | default: 4 %}
{%- if include.custom %}
{%- assign allcontrstr = include.custom %}
{%- elsif include.role %}
{%- assign rolefilter = include.role | downcase %}
{%- for contr in contributors_lookup %}
{%- assign contrrole = contr[1]['role'] | downcase %}
{%- if rolefilter == contrrole %}
{%- if allcontrstr %}
{%- assign allcontrstr = allcontrstr | append: ", " | append: contr[0] %}
{%- else %}
{%- assign allcontrstr = contr[0] %}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- else %}
{%- for page in site.pages %}
{%- if page.contributors and page.search_exclude != true and page.contributors.size != 0 %}
{%- assign pagecontr = page.contributors | join: ", " %}
{%- if allcontrstr %}
{%- assign allcontrstr = allcontrstr | append: ", " | append: pagecontr %}
{%- else %}
{%- assign allcontrstr = pagecontr %}
{%- endif %}
{%- endif %}
{%- endfor %}
{%- for contr in contributors_lookup %}
{%- if allcontrstr %}
{%- assign allcontrstr = allcontrstr | append: ", " | append: contr[0] %}
{%- else %}
{%- assign allcontrstr = contr[0] %}
{%- endif %}
{%- endfor %}
{%- endif %}
{%- assign allcontributors = allcontrstr | split: ", " | uniq %}
{%- unless include.sort == false %}
{%- assign allcontributors = allcontributors | sort %}
{%- endunless %}
{%- unless allcontributors.size == 0 %}
<div class="row row-cols-2 row-cols-sm-3{%- if nr < 4 %} row-cols-md-4{%- endif %} row-cols-xl-{{nr}} g-4 contributor-cards mb-4">
{%- for contributor_name in allcontributors %}
{%- assign data = contributors_lookup[contributor_name] %}
<div class="col">
{%- include contributor-card.html name=contributor_name image_url=data.image_url git=data.git email=data.email orcid=data.orcid role=data.role affiliation=data.affiliation %}
</div>
{%- endfor %}
</div>
{%- endunless %}