Skip to content

Sort people within lists by surname, add myself #106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/images/team/penelope-yong.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions team/team.ejs
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
<% items.forEach(item => {
if (item.title === "Team Members") {
// Update this to the number of initial members to keep unsorted
const m = 2;

// Separate the first m members
const firstMembers = item.members.slice(0, m);
const remainingMembers = item.members.slice(m);

// Sort the remaining members by last name
remainingMembers.sort((a, b) => {
const lastNameA = a.name.split(' ').pop().toLowerCase();
const lastNameB = b.name.split(' ').pop().toLowerCase();
return lastNameA.localeCompare(lastNameB);
});

// Recombine the arrays: unsorted first m members + sorted remaining members
item.members = firstMembers.concat(remainingMembers);
} else {
// Sort all members by last name if title is not "Team Members"
item.members.sort((a, b) => {
const lastNameA = a.name.split(' ').pop().toLowerCase();
const lastNameB = b.name.split(' ').pop().toLowerCase();
return lastNameA.localeCompare(lastNameB);
});
}
}); %>

<!-- ::: {.panel-tabset} -->
<% for (const item of items) { %>

Expand Down
9 changes: 7 additions & 2 deletions team/team.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,13 @@
- linkedin: https://www.linkedin.com/in/shravangoswami/
- mail: [email protected]



- name: Penelope Yong
image: penelope-yong.jpg
university: The Alan Turing Institute
links:
- github: https://github.com/penelopeysm
- mail: [email protected]

# GSOC Contributors:

- title: Google Summer of Code Students
Expand Down