]> Sergey Matveev's repositories - public-inbox.git/commitdiff
feed: there is only one atom feed, with all messages
authorEric Wong <e@80x24.org>
Mon, 21 Apr 2014 10:00:21 +0000 (10:00 +0000)
committerEric Wong <e@80x24.org>
Mon, 21 Apr 2014 10:00:21 +0000 (10:00 +0000)
This is not a blog.  All posts, whether replies or not,
carry equal weight.

Documentation/design_www.txt
lib/PublicInbox/Feed.pm
public-inbox.cgi
t/cgi.t

index 0d25a45a5dae5039c99bf84e483fc07e5616b214..226a22c9704b427ddea9620a27be9a6888043923 100644 (file)
@@ -3,8 +3,7 @@ URL naming
 
 ### Unstable endpoints
 /$LISTNAME/?r=$GIT_COMMIT                       -> HTML only
-/$LISTNAME/index.atom.xml                       -> Atom feed
-/$LISTNAME/all.atom.xml                         -> Atom feed, includes replies
+/$LISTNAME/atom.xml                             -> Atom feed
 
 ### Stable endpoints
 /$LISTNAME/m/$MESSAGE_ID.html                   -> HTML content (short quotes)
index 6658a52b8794698f9a2bc2c6b23d27c60ca54c4c..0f0528c91dbefea3b0d02d44cb9d3f666ec50f40 100644 (file)
@@ -39,7 +39,7 @@ sub generate {
                link => {
                        rel => 'self',
                        href => $feed_opts->{atomurl} ||
-                               "http://example.com/atom",
+                               "http://example.com/atom.xml",
                },
                id => $feed_opts->{address} || 'public-inbox@example.com',
                updated => POSIX::strftime(DATEFMT, gmtime),
@@ -208,15 +208,15 @@ sub get_feedopts {
                my $base = $cgi->url(-base);
                $url_base = $cgi_url;
                if ($url_base =~ s!/(?:|index\.html)?\z!!) {
-                       $rv{atomurl} = "$base$url_base/index.atom.xml";
+                       $rv{atomurl} = "$base$url_base/atom.xml";
                } else {
-                       $url_base =~ s!/?(?:index|all)\.atom\.xml\z!!;
+                       $url_base =~ s!/atom\.xml\z!!;
                        $rv{atomurl} = $base . $cgi_url;
                        $url_base = $base . $url_base; # XXX is this needed?
                }
        } else {
                $url_base = "http://example.com";
-               $rv{atomurl} = "$url_base/index.atom.xml";
+               $rv{atomurl} = "$url_base/atom.xml";
        }
        $rv{url} ||= "$url_base/";
        $rv{midurl} = "$url_base/m/";
index 03202c61736afa7887887ab7a8786a8584bc2105..33313bf55dd2b549bacd14413874e08e0701e87d 100755 (executable)
@@ -65,9 +65,7 @@ sub main {
                invalid_list(\%ctx, $1) || redirect_list_index(\%ctx, $cgi);
        } elsif ($path_info =~ m!$LISTNAME_RE(?:/|/index\.html)?\z!o) {
                invalid_list(\%ctx, $1) || get_index(\%ctx, $cgi, 0);
-       } elsif ($path_info =~ m!$LISTNAME_RE/index\.atom\.xml\z!o) {
-               invalid_list(\%ctx, $1) || get_atom(\%ctx, $cgi, 1);
-       } elsif ($path_info =~ m!$LISTNAME_RE/all\.atom\.xml\z!o) {
+       } elsif ($path_info =~ m!$LISTNAME_RE/atom\.xml\z!o) {
                invalid_list(\%ctx, $1) || get_atom(\%ctx, $cgi, 0);
 
        # single-message pages
@@ -114,8 +112,7 @@ sub invalid_list_mid {
        undef;
 }
 
-# /$LISTNAME/index.atom.xml                     -> Atom feed
-# /$LISTNAME/all.atom.xml                       -> Atom feed, includes replies
+# /$LISTNAME/atom.xml                       -> Atom feed, includes replies
 sub get_atom {
        my ($ctx, $cgi, $top) = @_;
        require PublicInbox::Feed;
diff --git a/t/cgi.t b/t/cgi.t
index f7035228e29534a70ebda7faeedbd99e82b2c6a0..365acd842c20ee5c91fcc1d9eac3e38ab3b1a82a 100644 (file)
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -102,16 +102,13 @@ EOF
 # atom feeds
 {
        local $ENV{HOME} = $home;
-       my $res = cgi_run("/test/all.atom.xml");
+       my $res = cgi_run("/test/atom.xml");
        like($res->{body}, qr/<title>test for public-inbox/,
                "set title in XML feed");
        like($res->{body},
                qr!http://test\.example\.com/test/m/blah%40example\.com!,
                "link id set");
        like($res->{body}, qr/what\?/, "reply included");
-
-       $res = cgi_run("/test/index.atom.xml");
-       unlike($res->{body}, qr/what\?/, "reply not included in index");
 }
 
 # indices