inline: change default sort order from age to "age title" for determinism

master
Simon McVittie 2015-06-11 08:33:04 +01:00
parent 8f1d511051
commit f2365c3e66
3 changed files with 15 additions and 6 deletions

View File

@ -160,16 +160,17 @@ sub preprocess_inline (@) {
# Running in scan mode: only do the essentials # Running in scan mode: only do the essentials
if (yesno($params{trail}) && IkiWiki::Plugin::trail->can("preprocess_trailitems")) { if (yesno($params{trail}) && IkiWiki::Plugin::trail->can("preprocess_trailitems")) {
# default to sorting age, the same as inline itself, # default to sorting by age with fallback to title,
# but let the params override that # the same as inline itself, but let the params
IkiWiki::Plugin::trail::preprocess_trailitems(sort => 'age', %params); # override that
IkiWiki::Plugin::trail::preprocess_trailitems(sort => 'age title', %params);
} }
return; return;
} }
if (yesno($params{trail}) && IkiWiki::Plugin::trail->can("preprocess_trailitems")) { 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}); my $raw=yesno($params{raw});
@ -245,7 +246,7 @@ sub preprocess_inline (@) {
@list = pagespec_match_list($params{page}, $params{pages}, @list = pagespec_match_list($params{page}, $params{pages},
deptype => deptype($quick ? "presence" : "content"), deptype => deptype($quick ? "presence" : "content"),
filter => sub { $_[0] eq $params{page} }, 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}), reverse => yesno($params{reverse}),
($num ? (num => $num) : ()), ($num ? (num => $num) : ()),
); );

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
ikiwiki (3.20150611) UNRELEASED; urgency=medium
* inline: change default sort order from age to "age title" for determinism
-- Simon McVittie <smcv@debian.org> Thu, 11 Jun 2015 08:32:35 +0100
ikiwiki (3.20150610) unstable; urgency=low ikiwiki (3.20150610) unstable; urgency=low
[ Joey Hess ] [ Joey Hess ]

View File

@ -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 markup around it, as if it were a literal part of the source of the
inlining page. inlining page.
* `sort` - Controls how inlined pages are [[sorted|pagespec/sorting]]. * `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. * `reverse` - If set to "yes", causes the sort order to be reversed.
* `feedshow` - Specify the maximum number of matching pages to include in * `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. the rss/atom feeds. The default is the same as the `show` value above.