diff options
author | Joey Hess <joey@kitenet.net> | 2007-12-17 15:33:47 -0500 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2007-12-17 15:33:47 -0500 |
commit | b72b8b2b0ec5888d53450db26e20252d1e18fb99 (patch) | |
tree | 54ce025da7128dd2e4d73233be3ca276d354d499 | |
parent | dd0b844477fd11ed2e9956c15b4a2b2e30e6586b (diff) | |
download | ikiwiki-b72b8b2b0ec5888d53450db26e20252d1e18fb99.tar ikiwiki-b72b8b2b0ec5888d53450db26e20252d1e18fb99.tar.gz |
improve error message if shortcuts.mdwn DNE
-rw-r--r-- | IkiWiki/Plugin/shortcut.pm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/shortcut.pm b/IkiWiki/Plugin/shortcut.pm index 0e7769c67..fb096ecbd 100644 --- a/IkiWiki/Plugin/shortcut.pm +++ b/IkiWiki/Plugin/shortcut.pm @@ -13,8 +13,11 @@ sub import { #{{{ sub checkconfig () { #{{{ # Preprocess the shortcuts page to get all the available shortcuts # defined before other pages are rendered. - IkiWiki::preprocess("shortcuts", "shortcuts", - readfile(srcfile("shortcuts.mdwn"))); + my $srcfile=eval {srcfile("shortcuts.mdwn")}; + if (! defined $srcfile) { + error(gettext("shortcut plugin will not work without a shortcuts.mdwn")); + } + IkiWiki::preprocess("shortcuts", "shortcuts", readfile($srcfile)); } # }}} sub preprocess_shortcut (@) { #{{{ |