@matheusbsbs / matheus-bagliano / commits / 1ba68ce237
Fork 0

gitweb: channel image in rss feed

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>

Giuseppe Bilotta committed Jan 26, 2009 at 12:50 UTC 1ba68ce23788dfc5cbe3501cb6b1ee95e68cf5a8
1 file changed +10
gitweb/gitweb.perl
+10
@@ -6075,6 +6075,16 @@ XML
6075 "<link>$alt_url</link>\n" .
6076 "<description>$descr</description>\n" .
6077 "<language>en</language>\n";
6078 + if (defined $logo || defined $favicon) {
6079 + # prefer the logo to the favicon, since RSS
6080 + # doesn't allow both
6081 + my $img = esc_url($logo || $favicon);
6082 + print "<image>\n" .
6083 + "<url>$img</url>\n" .
6084 + "<title>$title</title>\n" .
6085 + "<link>$alt_url</link>\n" .
6086 + "</image>\n";
6087 + }
6088 } elsif ($format eq 'atom') {
6089 print <<XML;
6090 <feed xmlns="http://www.w3.org/2005/Atom">