lib/PublicInbox/Feed.pm | 17 +++++++++-------- diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index cf64517bdf0a569a5b804d64d20166c24259f7fe..1eaba6c2c7362f7533dd09eb8906893dbfaaaf92 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -59,7 +59,7 @@ $title = PublicInbox::Hval->new_oneline($title)->as_html; my @messages; my $git = PublicInbox::GitCatFile->new($args->{git_dir}); - my $last = each_recent_blob($args, sub { + my ($first, $last) = each_recent_blob($args, sub { my $mime = do_cat_mail($git, $_[0]) or return 0; my $t = eval { str2time($mime->header('Date')) }; @@ -89,7 +89,7 @@ dump_msg($_, 0, \$html, time, \%seen) for $th->rootset; Email::Address->purge_cache; - my $footer = nav_footer($args->{cgi}, $last, $feed_opts); + my $footer = nav_footer($args->{cgi}, $first, $last, $feed_opts); my $list_footer = $args->{footer}; $footer .= "\n" . $list_footer if ($footer && $list_footer); $footer = "
" . PRE_WRAP . "$footer" if $footer; @@ -99,21 +99,22 @@ # private subs sub nav_footer { - my ($cgi, $last, $feed_opts) = @_; + my ($cgi, $first, $last, $feed_opts) = @_; $cgi or return ''; my $old_r = $cgi->param('r'); my $head = ' '; my $next = ' '; if ($last) { - $next = qq!next!; + $next = qq!next!; } if ($old_r) { $head = $cgi->path_info; - $head = qq!head!; + $head = qq!head!; } - my $atom = "{atomurl}\">atom"; - "$next $head $atom"; + my $atom = "{atomurl}\">atom"; + my $permalink = "permalink"; + "$next $head $atom $permalink"; } sub each_recent_blob { @@ -174,7 +175,7 @@ } close $log; # we may EPIPE here # for pagination - $commits[-1]; + ($commits[0], $commits[-1]); } # private functions below