]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/sortnaturally.pm
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
[git.ikiwiki.info.git] / IkiWiki / Plugin / sortnaturally.pm
index 0023f31f942b124cd3fc251fbbf55c7e34761f4f..b038b2f9a662358c015806bd22a7159c51b922c6 100644 (file)
@@ -7,13 +7,14 @@ no warnings;
 
 sub import {
        hook(type => "getsetup", id => "sortnaturally", call => \&getsetup);
+       hook(type => "checkconfig", id => "sortnaturally", call => \&checkconfig);
 }
 
 sub getsetup {
        return
                plugin => {
                        safe => 1,
-                       rebuild => 1,
+                       rebuild => undef,
                },
 }
 
@@ -22,11 +23,11 @@ sub checkconfig () {
        error $@ if $@;
 }
 
-package IkiWiki::PageSpec;
+package IkiWiki::SortSpec;
 
 sub cmp_title_natural {
-       Sort::Naturally::ncmp(IkiWiki::pagetitle(IkiWiki::basename($_[0])),
-               IkiWiki::pagetitle(IkiWiki::basename($_[1])))
+       Sort::Naturally::ncmp(IkiWiki::pagetitle(IkiWiki::basename($a)),
+               IkiWiki::pagetitle(IkiWiki::basename($b)))
 }
 
 1;