add paths to plugin files in copyright
[ikiwiki.git] / IkiWiki / Plugin / sortnaturally.pm
blobb038b2f9a662358c015806bd22a7159c51b922c6
1 #!/usr/bin/perl
2 # Sort::Naturally-powered title_natural sort order for IkiWiki
3 package IkiWiki::Plugin::sortnaturally;
5 use IkiWiki 3.00;
6 no warnings;
8 sub import {
9 hook(type => "getsetup", id => "sortnaturally", call => \&getsetup);
10 hook(type => "checkconfig", id => "sortnaturally", call => \&checkconfig);
13 sub getsetup {
14 return
15 plugin => {
16 safe => 1,
17 rebuild => undef,
21 sub checkconfig () {
22 eval q{use Sort::Naturally};
23 error $@ if $@;
26 package IkiWiki::SortSpec;
28 sub cmp_title_natural {
29 Sort::Naturally::ncmp(IkiWiki::pagetitle(IkiWiki::basename($a)),
30 IkiWiki::pagetitle(IkiWiki::basename($b)))