Skip to content

Commit a80e69e

Browse files
Sort people within lists by surname, add myself (#106)
* added Penolope in team.yml * sort members by lastname, keep m initial members unsorted --------- Co-authored-by: Shravan Goswami <[email protected]>
1 parent 5f7f81c commit a80e69e

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

assets/images/team/penelope-yong.jpg

356 KB
Loading

team/team.ejs

+28
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
<% items.forEach(item => {
2+
if (item.title === "Team Members") {
3+
// Update this to the number of initial members to keep unsorted
4+
const m = 2;
5+
6+
// Separate the first m members
7+
const firstMembers = item.members.slice(0, m);
8+
const remainingMembers = item.members.slice(m);
9+
10+
// Sort the remaining members by last name
11+
remainingMembers.sort((a, b) => {
12+
const lastNameA = a.name.split(' ').pop().toLowerCase();
13+
const lastNameB = b.name.split(' ').pop().toLowerCase();
14+
return lastNameA.localeCompare(lastNameB);
15+
});
16+
17+
// Recombine the arrays: unsorted first m members + sorted remaining members
18+
item.members = firstMembers.concat(remainingMembers);
19+
} else {
20+
// Sort all members by last name if title is not "Team Members"
21+
item.members.sort((a, b) => {
22+
const lastNameA = a.name.split(' ').pop().toLowerCase();
23+
const lastNameB = b.name.split(' ').pop().toLowerCase();
24+
return lastNameA.localeCompare(lastNameB);
25+
});
26+
}
27+
}); %>
28+
129
<!-- ::: {.panel-tabset} -->
230
<% for (const item of items) { %>
331

team/team.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,13 @@
217217
- linkedin: https://www.linkedin.com/in/shravangoswami/
218218
219219

220-
221-
220+
- name: Penelope Yong
221+
image: penelope-yong.jpg
222+
university: The Alan Turing Institute
223+
links:
224+
- github: https://github.com/penelopeysm
225+
226+
222227
# GSOC Contributors:
223228

224229
- title: Google Summer of Code Students

0 commit comments

Comments
 (0)