From 721c8ba356e169d2e3077f80367b93143adab297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 14 Nov 2025 15:19:36 +0100 Subject: [PATCH 1/2] Make avatar image smaller on mobile and add padding to person page sections --- templates/governance/person.html.hbs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/governance/person.html.hbs b/templates/governance/person.html.hbs index 6e55a760a..8f5d4d040 100644 --- a/templates/governance/person.html.hbs +++ b/templates/governance/person.html.hbs @@ -20,9 +20,9 @@ {{#*inline "page"}}
-
+
- + {{data.name}} @@ -39,7 +39,7 @@ {{# if data.active_teams }}
-
+

{{ fluent "governance-person-team-member" }}

@@ -53,7 +53,7 @@ {{# if data.alumni_teams }}
-
+

{{ fluent "governance-person-team-alumni" }}

From 4c869a50caa2e9ae4346c00da3828c8b0b59786b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 14 Nov 2025 15:29:57 +0100 Subject: [PATCH 2/2] Add link to GitHub sponsors to person profile page --- Cargo.lock | 2 +- src/render.rs | 4 +-- src/teams.rs | 50 +++++++++++++++++++--------- templates/governance/person.html.hbs | 7 +++- 4 files changed, 43 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 05a3efcf6..0435a0aa7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -792,7 +792,7 @@ dependencies = [ [[package]] name = "rust_team_data" version = "1.0.0" -source = "git+https://github.com/rust-lang/team#6e8fc802c561618d770eca05e76714e22c7af302" +source = "git+https://github.com/rust-lang/team#e98fd12441f487242a185921e25a53e0b07b1b36" dependencies = [ "indexmap", "serde", diff --git a/src/render.rs b/src/render.rs index 8c236cd61..4c6601dd2 100644 --- a/src/render.rs +++ b/src/render.rs @@ -2,7 +2,7 @@ use crate::assets::AssetFiles; use crate::fs::{copy_dir_all, ensure_directory}; use crate::i18n::{EXPLICIT_LOCALE_INFO, LocaleInfo, SUPPORTED_LOCALES}; use crate::rust_version::RustVersion; -use crate::teams::{PageData, RustTeams}; +use crate::teams::{PageData, RustTeamData}; use crate::{BaseUrl, ENGLISH, LAYOUT}; use anyhow::Context; use handlebars::Handlebars; @@ -84,7 +84,7 @@ pub struct RenderCtx<'a> { pub fluent_loader: SimpleLoader, pub output_dir: PathBuf, pub rust_version: RustVersion, - pub teams: RustTeams, + pub teams: RustTeamData, pub assets: AssetFiles, pub base_url: BaseUrl, } diff --git a/src/teams.rs b/src/teams.rs index 2c4df59b4..16b66003b 100644 --- a/src/teams.rs +++ b/src/teams.rs @@ -3,7 +3,7 @@ use handlebars::{ Context, Handlebars, Helper, HelperResult, Output, RenderContext, RenderErrorReason, }; use percent_encoding::{AsciiSet, NON_ALPHANUMERIC, utf8_percent_encode}; -use rust_team_data::v1::{BASE_URL, Team, TeamKind, TeamMember, Teams}; +use rust_team_data::v1::{BASE_URL, People, Person, Team, TeamKind, TeamMember, Teams}; use serde::Serialize; use std::cmp::Reverse; use std::collections::HashMap; @@ -49,17 +49,20 @@ pub fn encode_zulip_stream( } #[derive(Debug, Clone)] -pub struct RustTeams { +pub struct RustTeamData { pub teams: Vec, pub archived_teams: Vec, + // GitHub username => person data + pub people: HashMap, } -impl RustTeams { +impl RustTeamData { #[cfg(test)] fn dummy(teams: Vec) -> Self { - RustTeams { + RustTeamData { teams, archived_teams: vec![], + people: HashMap::new(), } } @@ -277,16 +280,21 @@ impl RustTeams { fn add_team( people: &mut HashMap, - ctx: &RustTeams, + ctx: &RustTeamData, member: &TeamMember, team: &Team, mode: TeamMode, ) { + let person_team_data = ctx + .people + .get(&member.github) + .unwrap_or_else(|| panic!("Person {} not found in people.json", member.github)); let person = people .entry(member.github.clone()) .or_insert_with(move || PersonData { name: member.name.clone(), github: member.github.clone(), + github_sponsors: person_team_data.github_sponsors, active_teams: vec![], alumni_teams: vec![], }); @@ -463,15 +471,16 @@ impl PersonTeam { pub struct PersonData { name: String, pub github: String, + github_sponsors: bool, active_teams: Vec, alumni_teams: Vec, } -pub fn load_rust_teams() -> anyhow::Result { +pub fn load_rust_teams() -> anyhow::Result { println!("Downloading Team API data"); // Parallelize the download to make website build faster - let (teams, archived_teams) = std::thread::scope(|scope| { + let (teams, archived_teams, people) = std::thread::scope(|scope| { let teams = scope.spawn(|| -> anyhow::Result { let response = fetch(&format!("{BASE_URL}/teams.json"))?; Ok(serde_json::from_str(&response)?) @@ -480,13 +489,22 @@ pub fn load_rust_teams() -> anyhow::Result { let response = fetch(&format!("{BASE_URL}/archived-teams.json"))?; Ok(serde_json::from_str(&response)?) }); - (teams.join().unwrap(), archived_teams.join().unwrap()) + let people = scope.spawn(|| -> anyhow::Result { + let response = fetch(&format!("{BASE_URL}/people.json"))?; + Ok(serde_json::from_str(&response)?) + }); + ( + teams.join().unwrap(), + archived_teams.join().unwrap(), + people.join().unwrap(), + ) }); - let (teams, archived_teams) = (teams?, archived_teams?); + let (teams, archived_teams, people) = (teams?, archived_teams?, people?); - Ok(RustTeams { + Ok(RustTeamData { teams: teams.teams.into_values().collect(), archived_teams: archived_teams.teams.into_values().collect(), + people: people.people.into_iter().collect(), }) } @@ -517,7 +535,7 @@ impl fmt::Display for TeamNotFound { #[cfg(test)] mod tests { - use super::{RustTeams, TeamNotFound}; + use super::{RustTeamData, TeamNotFound}; use rust_team_data::v1::{Team, TeamKind, TeamMember, TeamWebsite}; fn dummy_team(name: &str) -> Team { @@ -569,7 +587,7 @@ mod tests { fn test_index_data() { let mut foo = dummy_team("foo"); foo.kind = TeamKind::WorkingGroup; - let data = RustTeams::dummy(vec![foo, dummy_team("bar")]); + let data = RustTeamData::dummy(vec![foo, dummy_team("bar")]); let res = data.index_data(); assert_eq!(res.teams.len(), 1); @@ -581,7 +599,7 @@ mod tests { fn test_index_subteams_are_hidden() { let mut foo = dummy_team("foo"); foo.subteam_of = Some(String::new()); - let data = RustTeams::dummy(vec![foo]); + let data = RustTeamData::dummy(vec![foo]); assert_eq!(data.index_data().teams.len(), 0); } @@ -606,7 +624,7 @@ mod tests { other_wg.subteam_of = Some("other".into()); other_wg.kind = TeamKind::WorkingGroup; - let data = RustTeams::dummy(vec![ + let data = RustTeamData::dummy(vec![ main, subteam, subteam2, @@ -635,7 +653,7 @@ mod tests { let foo = dummy_team("foo"); let mut bar = dummy_team("bar"); bar.kind = TeamKind::WorkingGroup; - let data = RustTeams::dummy(vec![foo, bar]); + let data = RustTeamData::dummy(vec![foo, bar]); assert!( data.clone() @@ -663,7 +681,7 @@ mod tests { fn test_subteams_cant_be_loaded() { let mut foo = dummy_team("foo"); foo.subteam_of = Some("bar".into()); - let data = RustTeams::dummy(vec![foo, dummy_team("bar")]); + let data = RustTeamData::dummy(vec![foo, dummy_team("bar")]); assert!( data.page_data("teams", "foo") diff --git a/templates/governance/person.html.hbs b/templates/governance/person.html.hbs index 8f5d4d040..5506bb8db 100644 --- a/templates/governance/person.html.hbs +++ b/templates/governance/person.html.hbs @@ -20,7 +20,7 @@ {{#*inline "page"}}
-