[dw-free] make RSS feeds for specific tags more discoverable
[commit: http://hg.dwscoalition.org/dw-free/rev/4060651ad41a]
http://bugs.dwscoalition.org/show_bug.cgi?id=1560
Add 'add this RSS feed filtered by tags' link for discoverability by RSS
readers/browsers/etc.
Patch by
kareila.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=1560
Add 'add this RSS feed filtered by tags' link for discoverability by RSS
readers/browsers/etc.
Patch by
Files modified:
- cgi-bin/LJ/S2.pm
--------------------------------------------------------------------------------
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};
}
--------------------------------------------------------------------------------

no subject