]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/meta.pm
Reimplement extensible sorting mechanisms, in the same way as pagespecs
[ikiwiki.git] / IkiWiki / Plugin / meta.pm
index a470041c97a528700b575e5b1f59c7c31a390764..e8cc1e3927a13c3f89f87fe27800a26355ddd006 100644 (file)
@@ -13,7 +13,6 @@ sub import {
        hook(type => "needsbuild", id => "meta", call => \&needsbuild);
        hook(type => "preprocess", id => "meta", call => \&preprocess, scan => 1);
        hook(type => "pagetemplate", id => "meta", call => \&pagetemplate);
-       hook(type => "sort", id => "meta_title", call => \&sort_meta_title);
 }
 
 sub getsetup () {
@@ -299,10 +298,6 @@ sub titlesort {
        return pagetitle(IkiWiki::basename($_[0]));
 }
 
-sub sort_meta_title {
-       return titlesort($_[0]) cmp titlesort($_[1]);
-}
-
 sub match {
        my $field=shift;
        my $page=shift;
@@ -353,4 +348,10 @@ sub match_copyright ($$;@) {
        IkiWiki::Plugin::meta::match("copyright", @_);
 }
 
+sub cmp_meta_title {
+       IkiWiki::Plugin::meta::titlesort($_[0])
+       cmp
+       IkiWiki::Plugin::meta::titlesort($_[1])
+}
+
 1