]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: channel image in rss feed
authorGiuseppe Bilotta <redacted>
Mon, 26 Jan 2009 11:50:11 +0000 (12:50 +0100)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:38 +0000 (00:50 -0400)
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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index a1b1c3696854c91bb8d18e7cbaf1205728378535097ccac57f67f87b25742a8d..78f54e712ce3f66ad6ebea3a73333aa9ed26495a8111a27f20437fca06992102 100755 (executable)
@@ -6076,6 +6076,16 @@ XML
                      "<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">
This page took 0.278742 seconds and 4 git commands to generate.