Sort backlinks deterministically, by falling back to sorting by href if the link text is identical

master
Simon McVittie 2015-06-09 11:18:50 +01:00
parent fd7ab8a040
commit 6add4fd4fc
2 changed files with 3 additions and 1 deletions

View File

@ -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;

2
debian/changelog vendored
View File

@ -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