1 file changed, +3, -8
612d51bRead the last commit with commit_list[0] on the index and summary
author
mogi <git@paramogi.world> on 21-11-2026 14:52 UTC
committer
mogi <git@paramogi.world> on 21-11-2026 14:52 UTC
parent604ed57
+3, -8
      @@ -416,7 +416,7 @@ fn wrap_page(title: &str, nav: Option<&RepoNav>, body: &str) -> String {
416416 
417417 pub fn gen_index(repos: &[RepoInfo]) -> String {
418418     let mut sorted: Vec<&RepoInfo> = repos.iter().collect();
419   -    sorted.sort_by_key(|repo| Reverse(repo.commit_list.first().map(|c| c.committer_date)));
   419+    sorted.sort_by_key(|repo| Reverse(repo.commit_list[0].committer_date));
420420 
421421     let mut body = String::from("<div class=\"home-grid\">\n");
422422     for repo in sorted {
      @@ -468,19 +468,14 @@ pub fn gen_summary(
468468         depth: 0,
469469         path: "",
470470     };
471   -    let last_commit = repo
472   -        .commit_list
473   -        .first()
474   -        .map(|commit| commit.committer_date.format(DATE).to_string());
   471+    let last_commit = repo.commit_list[0].committer_date.format(DATE).to_string();
475472     let clone_url = format!("{CLONE_URL_BASE}{}.git", repo.name);
476473     let mut rows: Vec<(&str, &str)> =
477474         vec![("name", &repo.name), ("description", &repo.description)];
478475     if !repo.owner.is_empty() {
479476         rows.push(("owner", &repo.owner));
480477     }
481   -    if let Some(date) = &last_commit {
482   -        rows.push(("last commit", date));
483   -    }
   478+    rows.push(("last commit", &last_commit));
484479     rows.push(("clone url", &clone_url));
485480 
486481     let mut body = String::from("<div class=\"box summary-meta-box\">\n");