]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Show project's README.html if available
authorPetr Baudis <redacted>
Tue, 24 Oct 2006 03:23:46 +0000 (05:23 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:11 +0000 (00:07 -0400)
If the repository includes a README.html file, show it in the summary page.
The usual "this should be in the config file" argument does not apply here
since this can be larger and having such a big string in the config file
would be impractical.

I don't know if this is suitable upstream, but it's one of the repo.or.cz
custom modifications that I've thought could be interesting for others
as well.

Compared to the previous patch, this adds the '.html' extension to the
filename, so that it's clear it is, well, HTML.

Signed-off-by: Petr Baudis <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 99bf9301e951a3aefa337ea6927bb73ed4d404fc06b2b374c88a8e18e34de1ee..edc96ecfa2c3ec18da9a359ae02f8b1d2dc7d2aadc80c12c891af13ca0744ddd 100755 (executable)
@@ -2531,6 +2531,14 @@ sub git_summary {
        }
        print "</table>\n";
 
        }
        print "</table>\n";
 
+       if (-s "$projectroot/$project/README.html") {
+               if (open my $fd, "$projectroot/$project/README.html") {
+                       print "<div class=\"title\">readme</div>\n";
+                       print $_ while (<$fd>);
+                       close $fd;
+               }
+       }
+
        open my $fd, "-|", git_cmd(), "rev-list", "--max-count=17",
                git_get_head_hash($project)
                or die_error(undef, "Open git-rev-list failed");
        open my $fd, "-|", git_cmd(), "rev-list", "--max-count=17",
                git_get_head_hash($project)
                or die_error(undef, "Open git-rev-list failed");
This page took 0.166539 seconds and 4 git commands to generate.