From ca64273ff9b737c7a21e02042bbf01ef44452c94 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 6 Jun 2021 09:55:08 +0200 Subject: [PATCH] pageranges.py: add rel attribute to previous/next links These attributes allow some extensions to easily jump to the next/previous article. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel#attr-prev. --- pageranges.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pageranges.py b/pageranges.py index af84648..237c267 100644 --- a/pageranges.py +++ b/pageranges.py @@ -752,7 +752,9 @@ def prevnexttitle(context, idx): title = wikirend.nolinkstitlerend(nc) if not title: title = pg.path[len(rpath)+1:] - return '%s' % (context.nurl(pg), title) + direction = {0: "prev", 1: "next"}[idx] + return '%s' % (direction, + context.nurl(pg), title) def prevtitle(context): """Create a link to the previous page (if one exists) for the current page if the current page is in a blog directory but is