Skip to content

Commit a81c67f

Browse files
committed
Update pages for new author schema
1 parent 8929991 commit a81c67f

File tree

5 files changed

+99
-48
lines changed

5 files changed

+99
-48
lines changed
Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,69 @@
1-
1+
<!-- Control which set of authors to show for the people page -->
22
{% for hash in include.authors -%}
33
{% assign author = hash[1] -%}
44

5-
{% if author.alumni %}
6-
{% assign alumni = true %}
5+
{% assign show_author = false %}
6+
7+
{% if include.render_current_role %}
8+
9+
{% if author.current_role.type == include.role %}
10+
11+
{% if include.title %}
12+
{% if author.current_role.title == include.title %}
13+
{% assign show_author = true %}
14+
{% assign role_to_render = author.current_role %}
15+
{% endif %}
16+
717
{% else %}
8-
{% assign alumni = false %}
18+
19+
{% assign show_author = true %}
20+
{% assign role_to_render = author.current_role %}
21+
922
{% endif %}
1023

11-
{% if alumni == include.alumni %}
12-
{% if author.role == include.role %}
24+
{% endif %}
1325

14-
{% if alumni == false %}
15-
{% if author.role == "Faculty" or author.role == "Adjunct Faculty" or author.role == "Postdoc" %}
16-
{% assign loading = "eager" %}
1726
{% else %}
18-
{% assign loading = "lazy" %}
19-
{% endif %}
27+
28+
{% for past_role in author.past_roles %}
29+
30+
{% if past_role.type == include.role %}
31+
32+
{% if include.title %}
33+
{% if past_role.title == include.title %}
34+
{% assign show_author = true %}
35+
{% assign role_to_render = past_role %}
36+
{% break %}
2037
{% endif %}
2138

22-
{% include display-author.html author=author loading=loading %}
2339

24-
{%endif %}
40+
{% else %}
41+
42+
{% assign show_author = true %}
43+
{% assign role_to_render = past_role %}
44+
{% break %}
2545
{% endif %}
2646

47+
48+
49+
{% endif %}
2750
{% endfor %}
51+
52+
53+
{% endif %}
54+
55+
{% if show_author %}
56+
57+
{% assign loading = "lazy" %}
58+
{% if include.render_current_role %}
59+
{% unless author.current_role.type == "Student" %}
60+
{% assign loading = "eager" %}
61+
{% endunless %}
62+
{% endif %}
63+
64+
{% include display-author.html author=author loading=loading render_current_role=render_current_role
65+
role_to_render=role_to_render %}
66+
67+
{% endif %}
68+
69+
{% endfor %}

_includes/display-author.html

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- show-author-with-roles.html -->
1+
<!-- Show author next to post, should show most up to date info -->
22
<article class="author-card">
33
<div class="author-avatar">
44
{% if author.avatar %}
@@ -18,26 +18,33 @@
1818
{% endif %}
1919
</b>
2020

21-
{% if author.advisor %}
21+
{% if include.role_to_render %}
22+
2223
<div class="author-advisor">
24+
{% if include.role_to_render.type == "Student" %}
2325
<b>
24-
{% if author.role == "Postdoc" %}
25-
Working with:
26-
{% elsif author.role == "Intern" %}
26+
{% if include.role_to_render.title == "Intern" %}
2727
Hosted by:
2828
{% else %}
2929
Advised by:
3030
{% endif %}
3131
</b>
32-
{{ author.advisor }}
33-
{% if author.date %}
32+
{{ include.role_to_render.advisor }}
33+
{% else %}
34+
{{ include.role_to_render.title }}
35+
{% endif %}
36+
</div>
37+
{% if include.role_to_render.start_date %}
38+
<div class="author-advisor">
3439
<span>
35-
({{ author.date }})
40+
({{ include.role_to_render.start_date }}{% if include.role_to_render.end_date %}-{{
41+
include.role_to_render.end_date }}{% endif %})
3642
</span>
37-
{% endif %}
3843
</div>
3944
{% endif %}
4045

46+
{% endif %}
47+
4148
{% if author.bio %}
4249
<div class="author-bio">
4350
{{ author.bio }}
@@ -50,11 +57,13 @@
5057
</div>
5158
{% endif %}
5259

53-
{% if author.new_role %}
60+
{% unless include.render_current_role %}
61+
{% if author.current_role == "Unaffiliated" %}
5462
<div class="author-note">
55-
<b>➡️ </b> {{ author.new_role }}
63+
<b>➡️ </b> {{ author.current_role.title }}
5664
</div>
5765
{% endif %}
66+
{% endunless %}
5867

5968
{% if author.links %}
6069
<div class="author-links">

_includes/project.html

Whitespace-only changes.

_includes/research-directions.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
{% if r.logo_image_path %}
2121
<div class="research-directions-logo">
2222
{% if r.logo_dark_image_path %}
23-
<img src="{{ r.logo_image_path | relative_url }}" class="theme-image light-image"
23+
<img loading="lazy" src="{{ r.logo_image_path | relative_url }}" class="theme-image light-image"
2424
alt="{% if r.alt %}{{ r.alt }}{% endif %}">
25-
<img src="{{ r.logo_dark_image_path | relative_url }}" class="theme-image dark-image"
25+
<img loading="lazy" src="{{ r.logo_dark_image_path | relative_url }}" class="theme-image dark-image"
2626
alt="{% if r.alt %}{{ r.alt }}{% endif %}">
2727
{% else %}
28-
<img src="{{ r.logo_image_path | relative_url }}" alt="{{ r.title }}">
28+
<img loading="lazy" src="{{ r.logo_image_path | relative_url }}" alt="{{ r.title }}">
2929
{% endif %}
3030
</div>
3131
{% endif %}

_pages/people.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,57 +4,57 @@ permalink: /people/
44
layout: archive
55
---
66

7+
## Faculty & Staff & Postdoc
78

8-
## Faculty & Staff
9-
10-
{% include card-authors-with-role.html authors=site.data.authors role="Faculty" alumni=false %}
11-
{% include card-authors-with-role.html authors=site.data.authors role="Postdoc" alumni=false %}
12-
{% include card-authors-with-role.html authors=site.data.authors role="Research Assistant" alumni=false %}
13-
9+
{% include card-authors-with-role.html authors=site.data.authors role="Faculty" render_current_role=true %}
10+
{% include card-authors-with-role.html authors=site.data.authors role="Staff" render_current_role=true %}
11+
{% include card-authors-with-role.html authors=site.data.authors role="Postdoc" render_current_role=true %}
1412

1513
## Students
1614

1715
### PhD
1816

19-
{% include card-authors-with-role.html authors=site.data.authors role="PhD" alumni=false %}
17+
{% include card-authors-with-role.html authors=site.data.authors role="Student" title="PhD" render_current_role=true %}
2018

21-
### Masters
19+
### Master
2220

23-
{% include card-authors-with-role.html authors=site.data.authors role="Master" alumni=false %}
21+
{% include card-authors-with-role.html authors=site.data.authors role="Student" title="Master" render_current_role=true %}
2422

25-
### Undergraduate
23+
<!-- ### Undergraduate
2624
27-
{% include card-authors-with-role.html authors=site.data.authors role="Undergraduate" alumni=false %}
25+
{% include card-authors-with-role.html authors=site.data.authors role="Student" title="Undergraduate" render_current_role=true %}
2826
29-
### Interns
27+
### Intern
3028
31-
{% include card-authors-with-role.html authors=site.data.authors role="Intern" alumni=false %}
29+
{% include card-authors-with-role.html authors=site.data.authors role="Student" title="Intern" render_current_role=true %} -->
3230

3331
---
3432

35-
# Alumni
33+
# Past Members
3634

37-
## Faculty & Staff
35+
## Faculty & Staff & Postdoc
3836

39-
{% include card-authors-with-role.html authors=site.data.authors role="Postdoc" alumni=true %}
37+
{% include card-authors-with-role.html authors=site.data.authors role="Faculty" render_current_role=false %}
38+
{% include card-authors-with-role.html authors=site.data.authors role="Staff" render_current_role=false %}
39+
{% include card-authors-with-role.html authors=site.data.authors role="Postdoc" render_current_role=false %}
4040

41-
## Students
41+
## Alumni
4242

4343
### PhD
4444

45-
{% include card-authors-with-role.html authors=site.data.authors role="PhD" alumni=true %}
45+
{% include card-authors-with-role.html authors=site.data.authors role="Student" title="PhD" render_current_role=false %}
4646

4747
### Masters
4848

49-
{% include card-authors-with-role.html authors=site.data.authors role="Master" alumni=true %}
49+
{% include card-authors-with-role.html authors=site.data.authors role="Student" title="Master" render_current_role=false %}
5050

5151
### Undergraduate
5252

53-
{% include card-authors-with-role.html authors=site.data.authors role="Undergraduate" alumni=true %}
53+
{% include card-authors-with-role.html authors=site.data.authors role="Student" title="Undergraduate" render_current_role=false %}
5454

5555
### Interns
5656

57-
{% include card-authors-with-role.html authors=site.data.authors role="Intern" alumni=true %}
57+
{% include card-authors-with-role.html authors=site.data.authors role="Student" title="Intern" render_current_role=false %}
5858

5959
<br/>
6060

0 commit comments

Comments
 (0)