Skip to content

Commit

Permalink
gitweb: Show project's README.html if available
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Petr Baudis authored and Junio C Hamano committed Oct 24, 2006
1 parent 8be2890 commit 447ef09
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -2530,6 +2530,14 @@ sub git_summary {
}
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");
Expand Down

0 comments on commit 447ef09

Please sign in to comment.