Skip to content

Commit 1ba68ce

Browse files
Oblomovgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 85b4518 commit 1ba68ce

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

gitweb/gitweb.perl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6075,6 +6075,16 @@ sub git_feed {
60756075
"<link>$alt_url</link>\n" .
60766076
"<description>$descr</description>\n" .
60776077
"<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+
}
60786088
} elsif ($format eq 'atom') {
60796089
print <<XML;
60806090
<feed xmlns="http://www.w3.org/2005/Atom">

0 commit comments

Comments
 (0)