aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2015-06-09 11:18:50 +0100
committerSimon McVittie <smcv@debian.org>2015-06-09 22:30:43 +0100
commit6add4fd4fc63e9cc7829ae57d693e5b6832637bd (patch)
tree9bf15e2eca61363ba0162a54a8d7be6f191e36cc
parentfd7ab8a04030ac6ce270fd7f92388ad93e44f69c (diff)
downloadikiwiki-6add4fd4fc63e9cc7829ae57d693e5b6832637bd.tar
ikiwiki-6add4fd4fc63e9cc7829ae57d693e5b6832637bd.tar.gz
Sort backlinks deterministically, by falling back to sorting by href if the link text is identical
-rw-r--r--IkiWiki/Render.pm2
-rw-r--r--debian/changelog2
2 files changed, 3 insertions, 1 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index bdebaa645..4c998b156 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -111,7 +111,7 @@ sub genpage ($$) {
}
templateactions($template, $page);
- my @backlinks=sort { $a->{page} cmp $b->{page} } backlinks($page);
+ my @backlinks=sort { $a->{page} cmp $b->{page} || $a->{url} cmp $b->{url} } backlinks($page);
my ($backlinks, $more_backlinks);
if (@backlinks <= $config{numbacklinks} || ! $config{numbacklinks}) {
$backlinks=\@backlinks;
diff --git a/debian/changelog b/debian/changelog
index 526aa12ed..de2d99b28 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,6 +31,8 @@ ikiwiki (3.20150330) UNRELEASED; urgency=medium
* Add [[!meta date]] to news items and tips, since the git checkout
and build process can leave the checkout date in the tarball
release, leading to unstable sorting
+ * Sort backlinks deterministically, by falling back to sorting by href
+ if the link text is identical
-- Joey Hess <id@joeyh.name> Tue, 28 Apr 2015 12:24:08 -0400