From 48e004acb1cd8d09dfa52377bd48edaee293bc9f Mon Sep 17 00:00:00 2001 From: joey Date: Mon, 25 Sep 2006 21:13:14 +0000 Subject: * inline: Add ability to sort by page name, based on a patch from Benjamin A'Lee. --- IkiWiki/Plugin/inline.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'IkiWiki') 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]; } -- cgit v1.2.3