diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2009-01-26 12:50:11 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-01-28 14:13:54 -0800 |
commit | 1ba68ce23788dfc5cbe3501cb6b1ee95e68cf5a8 (patch) | |
tree | be441a2cfc118a1f937b010f91a5844184cc401c /gitweb | |
parent | Makefile: Make 'configure --with-expat=path' actually work (diff) | |
download | tgif-1ba68ce23788dfc5cbe3501cb6b1ee95e68cf5a8.tar.xz |
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>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 931db4f7eb..f8a5d2e077 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -6075,6 +6075,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"> |