- my $footer = nav_footer($ctx->{cgi}, $last, $feed_opts, $state);
+ $fh->write("<html><head><title>$title</title>" .
+ "<link\nrel=alternate\ntitle=\"Atom feed\"\n".
+ "href=\"new.atom\"\ntype=\"application/atom+xml\"/>" .
+ PublicInbox::Hval::STYLE .
+ "</head><body>$top");
+
+ # if the 'r' query parameter is given, it is a legacy permalink
+ # which we must continue supporting:
+ my $cgi = $ctx->{cgi};
+ if ($cgi && !$cgi->param('r') && $srch) {
+ $state->{srch} = $srch;
+ $last = PublicInbox::View::emit_index_topics($state, $fh);
+ $param = 'o';
+ } else {
+ $last = emit_index_nosrch($ctx, $state, $fh);
+ $param = 'r';
+ }
+ $footer = nav_footer($cgi, $last, $feed_opts, $state, $param);