Add 'add this RSS feed filtered by tags' link for discoverability by 
RSS readers/browsers/etc.

        Patch by kareila. 

diffs (19 lines):

diff -r c90b294a40e7 -r 4060651ad41a cgi-bin/LJ/S2.pm
--- a/cgi-bin/LJ/S2.pm  Sun Aug 09 17:43:37 2009 +0000
+++ b/cgi-bin/LJ/S2.pm  Mon Aug 10 01:53:23 2009 +0000
@@ -2042,8 +2042,13 @@ sub Page
 
     # Automatic Discovery of RSS/Atom
     if ($opts && $opts->{'addfeeds'}) {
-        $p->{'head_content'} .= qq{<link rel="alternate" 
type="application/rss+xml" title="RSS" href="$p->{'base_url'}/data/rss" />\n};
-        $p->{'head_content'} .= qq{<link rel="alternate" 
type="application/atom+xml" title="Atom" href="$p->{'base_url'}/data/atom" 
/>\n};
+        if ( $opts->{'tags'} ) {
+            my $taglist = join( ',', map( { LJ::eurl($_) } @{$opts->{tags}} ) 
);
+            $p->{'head_content'} .= qq{<link rel="alternate" 
type="application/rss+xml" title="RSS: filtered by selected tags" 
href="$p->{'base_url'}/data/rss?tag=$taglist" />\n};
+            $p->{'head_content'} .= qq{<link rel="alternate" 
type="application/atom+xml" title="Atom: filtered by selected tags" 
href="$p->{'base_url'}/data/atom?tag=$taglist" />\n};
+        }
+        $p->{'head_content'} .= qq{<link rel="alternate" 
type="application/rss+xml" title="RSS: all entries" 
href="$p->{'base_url'}/data/rss" />\n};
+        $p->{'head_content'} .= qq{<link rel="alternate" 
type="application/atom+xml" title="Atom: all entries" 
href="$p->{'base_url'}/data/atom" />\n};
         $p->{'head_content'} .= qq{<link rel="service.feed" 
type="application/atom+xml" title="AtomAPI-enabled feed" 
href="$LJ::SITEROOT/interface/atomapi/$u->{'user'}/feed" />\n};
         $p->{'head_content'} .= qq{<link rel="service.post" 
type="application/atom+xml" title="Create a new post" 
href="$LJ::SITEROOT/interface/atomapi/$u->{'user'}/post" />\n};
     }
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to