]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/View.pm
www: add rel=next and rel=prev navigation hints
[public-inbox.git] / lib / PublicInbox / View.pm
index 3b2df463f31f8bd8a7a065b95cc995e606d46a26..63810dcbcaca74d81e45dedb1ab4c4e112381c4f 100644 (file)
@@ -30,7 +30,7 @@ sub msg_html {
        headers_to_html_header($hdr, $ctx) .
                multipart_text_as_html($mime) .
                '</pre><hr /><pre>' .
-               html_footer($hdr, 1, $ctx) .
+               html_footer($hdr, 1, $ctx, 'R/') .
                $footer .
                '</pre></body></html>';
 }
@@ -139,7 +139,7 @@ sub index_entry {
                index_walk($fh, $_[0], $enc, \$part_nr);
        });
        $mime->body_set('');
-       $rv = "\n" . html_footer($hdr, 0, $ctx, $mhref);
+       $rv = "\n" . html_footer($hdr, 0, $ctx, "$path$href/R");
 
        if (defined $irt) {
                unless (defined $parent_anchor) {
@@ -154,13 +154,15 @@ sub index_entry {
        } elsif ($srch) {
                my $threaded = 'threaded';
                my $flat = 'flat';
+               my $end = '';
                if ($ctx->{flat}) {
                        $flat = "<b>$flat</b>";
+                       $end = "\n"; # for lynx
                } else {
                        $threaded = "<b>$threaded</b>";
                }
                $rv .= " [<a\nhref=\"${path}$href/t/#u\">$threaded</a>";
-               $rv .= "|<a\nhref=\"${path}$href/T/#u\">$flat</a>]";
+               $rv .= "|<a\nhref=\"${path}$href/T/#u\">$flat</a>]$end";
        }
        $fh->write($rv .= '</pre>');
 }
@@ -496,7 +498,7 @@ sub mailto_arg_link {
 }
 
 sub html_footer {
-       my ($hdr, $standalone, $ctx, $mhref) = @_;
+       my ($hdr, $standalone, $ctx, $rhref) = @_;
 
        my $srch = $ctx->{srch} if $ctx;
        my $upfx = '../';
@@ -511,12 +513,12 @@ sub html_footer {
                if ($p) {
                        $p = PublicInbox::Hval->new_msgid($p);
                        $p = $p->as_href;
-                       $irt = "<a\nhref=\"$upfx$p/\">parent</a> ";
+                       $irt = "<a\nhref=\"$upfx$p/\"rel=prev>parent</a> ";
                } else {
                        $irt = ' ' x length('parent ');
                }
                if ($next) {
-                       $irt .= "<a\nhref=\"$upfx$next/\">next</a> ";
+                       $irt .= "<a\nhref=\"$upfx$next/\"\nrel=next>next</a> ";
                } else {
                        $irt .= ' ' x length('next ');
                }
@@ -524,7 +526,7 @@ sub html_footer {
                $irt = '';
        }
 
-       $irt . qq(<a\nhref="${tpfx}R/">reply</a>) . $idx;
+       $irt . qq(<a\nhref="$rhref">reply</a>) . $idx;
 }
 
 sub linkify_ref_nosrch {