1- <!-- Control which set of authors to show for the people page -->
2- {% for hash in include.authors - %}
3- {% assign author = hash[1] - %}
4-
1+ <!-- First collect the authors that should be shown -->
2+ {% assign authors_to_show = '' | split: '' %}
3+ {% for hash in include.authors %}
4+ {% assign author = hash[1] %}
55{% assign show_author = false %}
66
77{% if include.render_current_role %}
8-
98{% if author.current_role.type == include.role %}
10-
119{% if include.title %}
1210{% if author.current_role.title == include.title %}
1311{% assign show_author = true %}
1412{% assign role_to_render = author.current_role %}
1513{% endif %}
16-
1714{% else %}
18-
1915{% assign show_author = true %}
2016{% assign role_to_render = author.current_role %}
21-
2217{% endif %}
23-
2418{% endif %}
25-
2619{% else %}
27-
2820{% for past_role in author.past_roles %}
29-
3021{% if past_role.type == include.role %}
31-
3222{% if include.title %}
3323{% if past_role.title == include.title %}
3424{% assign show_author = true %}
3525{% assign role_to_render = past_role %}
3626{% break %}
3727{% endif %}
38-
39-
4028{% else %}
41-
4229{% assign show_author = true %}
4330{% assign role_to_render = past_role %}
4431{% break %}
4532{% endif %}
33+ {% endif %}
34+ {% endfor %}
35+ {% endif %}
4636
37+ {% if show_author %}
38+ {% assign entry = "" | split: "" %}
39+ {% assign start_date = role_to_render.start_date | default: "9999" %}
40+
41+ {% if start_date contains "Fall" or start_date contains "Winter" or start_date contains "Summer" %}
42+ {% assign season_year = start_date | split: " " %}
43+ {% if season_year[0] == "Fall" %}
44+ {% assign month = "09" %}
45+ {% elsif season_year[0] == "Winter" %}
46+ {% assign month = "01" %}
47+ {% elsif season_year[0] == "Summer" %}
48+ {% assign month = "05" %}
49+ {% endif %}
50+ {% assign formatted_date = season_year[1] | append: month %}
51+ {% else %}
52+ {% assign formatted_date = start_date | date: "%Y%m" %}
53+ {% endif %}
4754
48-
55+ {% assign sort_key = formatted_date | append: "|" | append: author.name %}
56+ {% assign entry = entry | push: sort_key %}
57+ {% assign entry = entry | push: author %}
58+ {% assign entry = entry | push: role_to_render %}
59+ {% assign authors_to_show = authors_to_show | push: entry %}
4960{% endif %}
61+
62+
5063{% endfor %}
5164
5265
53- {% endif %}
66+ {% assign sorted_authors = authors_to_show | sort %}
5467
55- {% if show_author %}
68+ <!-- Then display the filtered authors -->
69+ {% for entry in sorted_authors %}
70+ {% assign author = entry[1] %}
71+ {% assign role_to_render = entry[2] %}
5672
5773{% assign loading = "lazy" %}
5874{% if include.render_current_role %}
6177{% endunless %}
6278{% endif %}
6379
64- {% include display-author.html author=author loading=loading render_current_role=include.render_current_role
80+ {% include display-author.html
81+ author=author
82+ loading=loading
83+ render_current_role=include.render_current_role
6584role_to_render=role_to_render %}
66-
67- {% endif %}
68-
6985{% endfor %}
0 commit comments