X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FFeed.pm;h=a5828a8e16bf9f475c1897b60f7cd4279e064c24;hb=8968889e3ebfa09dd2c80fe8b917b83ac13ff356;hp=150bea038241b57addb71cd34866d71cac3f7c7f;hpb=4c2c2325d2948ec5340e2fcafbee798cf568f5fd;p=public-inbox.git diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 150bea03..a5828a8e 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -55,7 +55,8 @@ sub atom_header { qq(\n) . qq{} . qq{$title} . - qq({url}"/>) . + qq() . qq({atomurl}"/>) . qq(mailto:$feed_opts->{id_addr}); } @@ -120,26 +121,25 @@ sub emit_html_index { my $title = $feed_opts->{description} || ''; $title = PublicInbox::Hval->new_oneline($title)->as_html; - my $atom_url = $feed_opts->{atomurl}; my ($footer, $param, $last); my $state = { ctx => $ctx, seen => {}, anchor_idx => 0 }; my $srch = $ctx->{srch}; - my $top = "$title (Atom feed)"; + my $top = "$title (Atom feed)"; if ($srch) { - $top = qq{$top} . + $top = qq{
$top} .
 			  qq{ } .
 			  qq{} .
-			  qq{} .
-			  PublicInbox::Hval::PRE;
+			  q{
}
 	} else {
-		$top = PublicInbox::Hval::PRE . $top . "\n";
+		$top = '
' . $top . "\n";
 	}
 
 	$fh->write("$title" .
 		   "" .
+		   "href=\"new.atom\"\ntype=\"application/atom+xml\"/>" .
+		   PublicInbox::Hval::STYLE .
 		   "$top");
 
 	# if the 'r' query parameter is given, it is a legacy permalink
@@ -194,7 +194,7 @@ sub nav_footer {
 		$head = $cgi->path_info;
 		$head = qq!head!;
 	}
-	my $atom = "{atomurl}\">Atom";
+	my $atom = "{atomurl}\">Atom feed";
 	"page: $next $head $atom";
 }
 
@@ -284,14 +284,7 @@ sub get_feedopts {
 
 	my $url_base;
 	if ($cgi) {
-		my $base;
-		if (ref($cgi) eq 'CGI') {
-			$base = $cgi->url(-base);
-		} else {
-			$base = $cgi->base->as_string;
-			$base =~ s!/\z!!;
-		}
-		$url_base = "$base/$listname";
+		$url_base = $cgi->base->as_string . $listname;
 		if (my $mid = $ctx->{mid}) { # per-thread feed:
 			$rv{atomurl} = "$url_base/$mid/t.atom";
 		} else {