aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2010-03-24 00:29:10 +0000
committerSimon McVittie <smcv@debian.org>2010-03-24 00:29:10 +0000
commite67a9382f67e745af3be7d367fe7a0d36c1777e6 (patch)
treea8c244b493dbc96b13488df948f5ac90718df45a /IkiWiki.pm
parente74a85c671cf9fe1e445ad183d66e059beaec2f9 (diff)
downloadikiwiki-e67a9382f67e745af3be7d367fe7a0d36c1777e6.tar
ikiwiki-e67a9382f67e745af3be7d367fe7a0d36c1777e6.tar.gz
Allow hooks to add sorting functions to pagespec_match_list
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index 022bfe3bd..1a4dc47dd 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -2035,7 +2035,11 @@ sub pagespec_match_list ($$;@) {
if (defined $params{sort}) {
my $f;
- if ($params{sort} eq 'title') {
+
+ if (exists $hooks{sort}{$params{sort}}{call}) {
+ $f = sub { $hooks{sort}{$params{sort}}{call}($a, $b) };
+ }
+ elsif ($params{sort} eq 'title') {
$f=sub { pagetitle(basename($a)) cmp pagetitle(basename($b)) };
}
elsif ($params{sort} eq 'title_natural') {