gitweb: Show project's README.html if available
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 <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
Petr Baudis committed
Oct 24, 2006 at 05:23 UTC
447ef09a5cf98bea28ec5123b968c966afce5772
1 file changed
+8
gitweb/gitweb.perl
+8
@@ -2530,6 +2530,14 @@ sub git_summary {
2530
}
2531
print "</table>\n";
2532
2533
+ if (-s "$projectroot/$project/README.html") {
2534
+ if (open my $fd, "$projectroot/$project/README.html") {
2535
+ print "<div class=\"title\">readme</div>\n";
2536
+ print $_ while (<$fd>);
2537
+ close $fd;
2538
+ }
2539
+ }
2540
+
2541
open my $fd, "-|", git_cmd(), "rev-list", "--max-count=17",
2542
git_get_head_hash($project)
2543
or die_error(undef, "Open git-rev-list failed");