Skip to content

Commit

Permalink
gitweb: channel image in rss feed
Browse files Browse the repository at this point in the history
Define the channel image for the rss feed when the logo or favicon are
defined, preferring the former to the latter. As suggested in the RSS
2.0 specifications, the image's title and link as set to the same as the
channel's.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Giuseppe Bilotta authored and Junio C Hamano committed Jan 28, 2009
1 parent 85b4518 commit 1ba68ce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -6075,6 +6075,16 @@ sub git_feed {
"<link>$alt_url</link>\n" .
"<description>$descr</description>\n" .
"<language>en</language>\n";
if (defined $logo || defined $favicon) {
# prefer the logo to the favicon, since RSS
# doesn't allow both
my $img = esc_url($logo || $favicon);
print "<image>\n" .
"<url>$img</url>\n" .
"<title>$title</title>\n" .
"<link>$alt_url</link>\n" .
"</image>\n";
}
} elsif ($format eq 'atom') {
print <<XML;
<feed xmlns="http://www.w3.org/2005/Atom">
Expand Down

0 comments on commit 1ba68ce

Please sign in to comment.