From f2365c3e660fe0b00a051ce893cdcad0016e560e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 11 Jun 2015 08:33:04 +0100 Subject: [PATCH] inline: change default sort order from age to "age title" for determinism --- IkiWiki/Plugin/inline.pm | 11 ++++++----- debian/changelog | 6 ++++++ doc/ikiwiki/directive/inline.mdwn | 4 +++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 300941943..416df1e28 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -160,16 +160,17 @@ sub preprocess_inline (@) { # Running in scan mode: only do the essentials if (yesno($params{trail}) && IkiWiki::Plugin::trail->can("preprocess_trailitems")) { - # default to sorting age, the same as inline itself, - # but let the params override that - IkiWiki::Plugin::trail::preprocess_trailitems(sort => 'age', %params); + # default to sorting by age with fallback to title, + # the same as inline itself, but let the params + # override that + IkiWiki::Plugin::trail::preprocess_trailitems(sort => 'age title', %params); } return; } if (yesno($params{trail}) && IkiWiki::Plugin::trail->can("preprocess_trailitems")) { - scalar IkiWiki::Plugin::trail::preprocess_trailitems(sort => 'age', %params); + scalar IkiWiki::Plugin::trail::preprocess_trailitems(sort => 'age title', %params); } my $raw=yesno($params{raw}); @@ -245,7 +246,7 @@ sub preprocess_inline (@) { @list = pagespec_match_list($params{page}, $params{pages}, deptype => deptype($quick ? "presence" : "content"), filter => sub { $_[0] eq $params{page} }, - sort => exists $params{sort} ? $params{sort} : "age", + sort => exists $params{sort} ? $params{sort} : "age title", reverse => yesno($params{reverse}), ($num ? (num => $num) : ()), ); diff --git a/debian/changelog b/debian/changelog index 5744a09b2..d29819f97 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ikiwiki (3.20150611) UNRELEASED; urgency=medium + + * inline: change default sort order from age to "age title" for determinism + + -- Simon McVittie Thu, 11 Jun 2015 08:32:35 +0100 + ikiwiki (3.20150610) unstable; urgency=low [ Joey Hess ] diff --git a/doc/ikiwiki/directive/inline.mdwn b/doc/ikiwiki/directive/inline.mdwn index a4632a5b4..32fecd1bf 100644 --- a/doc/ikiwiki/directive/inline.mdwn +++ b/doc/ikiwiki/directive/inline.mdwn @@ -94,7 +94,9 @@ Here are some less often needed parameters: markup around it, as if it were a literal part of the source of the inlining page. * `sort` - Controls how inlined pages are [[sorted|pagespec/sorting]]. - The default is to sort the newest created pages first. + The default is to sort the newest created pages first, and if pages + were created in the same commit, sort them by the name of the page + (equivalent to `sort="age title"`). * `reverse` - If set to "yes", causes the sort order to be reversed. * `feedshow` - Specify the maximum number of matching pages to include in the rss/atom feeds. The default is the same as the `show` value above. -- 2.39.2