aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2009-03-19 15:35:57 -0400
committerJoey Hess <joey@gnu.kitenet.net>2009-03-19 15:35:57 -0400
commitbb258b56b29cb01f27bdc0dfd0bced55a88574ed (patch)
treed7f35854bfa1074d40757d89733d89eab99d8d4d /IkiWiki/Plugin
parent55b83cb7bd1cd7c60bb45dc22c3745dd80a63fed (diff)
downloadikiwiki-bb258b56b29cb01f27bdc0dfd0bced55a88574ed.tar
ikiwiki-bb258b56b29cb01f27bdc0dfd0bced55a88574ed.tar.gz
avoid crashing if Sort::Naturally is not installed
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/inline.pm5
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') {