diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-03-19 15:35:57 -0400 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-03-19 15:35:57 -0400 |
commit | bb258b56b29cb01f27bdc0dfd0bced55a88574ed (patch) | |
tree | d7f35854bfa1074d40757d89733d89eab99d8d4d | |
parent | 55b83cb7bd1cd7c60bb45dc22c3745dd80a63fed (diff) | |
download | ikiwiki-bb258b56b29cb01f27bdc0dfd0bced55a88574ed.tar ikiwiki-bb258b56b29cb01f27bdc0dfd0bced55a88574ed.tar.gz |
avoid crashing if Sort::Naturally is not installed
-rw-r--r-- | IkiWiki/Plugin/inline.pm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index a89e827c1..218fd7515 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -195,7 +195,10 @@ sub preprocess_inline (@) { @list=sort { pagetitle(basename($a)) cmp pagetitle(basename($b)) } @list; } elsif (exists $params{sort} && $params{sort} eq 'title_natural') { - require Sort::Naturally; + eval q{use Sort::Naturally}; + if ($@) { + error(gettext("Sort::Naturally needed for title_natural sort")); + } @list=sort { Sort::Naturally::ncmp(pagetitle(basename($a)), pagetitle(basename($b))) } @list; } elsif (exists $params{sort} && $params{sort} eq 'mtime') { |