fix repo h1 generated even when no author has commits - fixes #585

Wed, 05 Feb 2025 23:51:33 +0100

author
Mike Becker <universe@uap-core.de>
date
Wed, 05 Feb 2025 23:51:33 +0100
changeset 24
2a4e97fc5ce5
parent 23
b4979c194dc8
child 25
b8d6b14c1555

fix repo h1 generated even when no author has commits - fixes #585

src/main.cpp file | annotate | diff | comparison | revisions
--- a/src/main.cpp	Tue Feb 04 22:23:09 2025 +0100
+++ b/src/main.cpp	Wed Feb 05 23:51:33 2025 +0100
@@ -256,10 +256,13 @@
 
     html::open(settings.fragment);
     for (const auto &[repo, authors] : heatmap.data()) {
-        html::h1(repo);
+        bool h1_rendered = false;
         for (const auto &[author, entries] : authors) {
             if (settings.exclude_author(author)) continue;
-
+            if (!h1_rendered) {
+                html::h1(repo);
+                h1_rendered = true;
+            }
             html::h2(author);
             html::table_begin(report_year);
 

mercurial