summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/inline.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 79e64beac..868f3816f 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -59,7 +59,17 @@ sub preprocess_inline (@) { #{{{
push @list, $page;
}
}
- @list=sort { $pagectime{$b} <=> $pagectime{$a} } @list;
+
+ if (exists $params{sort} && $params{sort} eq 'title') {
+ @list=sort @list;
+ }
+ elsif (! exists $params{sort} || $params{sort} eq 'age') {
+ @list=sort { $pagectime{$b} <=> $pagectime{$a} } @list;
+ }
+ else {
+ return "unknown sort type $params{sort}";
+ }
+
if ($params{show} && @list > $params{show}) {
@list=@list[0..$params{show} - 1];
}