]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www: add rel=next and rel=prev navigation hints
authorEric Wong <e@80x24.org>
Mon, 25 Apr 2016 01:00:24 +0000 (01:00 +0000)
committerEric Wong <e@80x24.org>
Mon, 25 Apr 2016 01:00:24 +0000 (01:00 +0000)
This can makes navigation easier with some browsers or
or browser extensions.

ref: https://www.w3.org/TR/html/links.html#sequential-link-types

lib/PublicInbox/Feed.pm
lib/PublicInbox/View.pm

index 096bff9d5c10c3850d1ba7bbb2c3329e487639de..d433726fb8d624506fa423bb3b2fd6f589566fa7 100644 (file)
@@ -185,7 +185,7 @@ sub nav_footer {
        my $anchor = $state->{anchor_idx};
 
        if ($last) {
-               $next = qq!<a\nhref="?$param=$last">next</a>!;
+               $next = qq!<a\nhref="?$param=$last"\nrel=next>next</a>!;
        }
        if ($old_r) {
                $head = $cgi->path_info;
index 177a1a6f4cc0b10e786b003eebae59a257b1623c..63810dcbcaca74d81e45dedb1ab4c4e112381c4f 100644 (file)
@@ -513,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 ');
                }