aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/edittemplate.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-07-13 15:05:34 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-07-13 15:05:34 -0400
commitffc99f5904934e6e7532bb8cfdebb44ad9ecd913 (patch)
treeec5d4d68b68c4fbbd77d33b51e59056ec011bc80 /IkiWiki/Plugin/edittemplate.pm
parentedb59cd5b949de7a68f3b74e7949bf3893b23c6a (diff)
downloadikiwiki-ffc99f5904934e6e7532bb8cfdebb44ad9ecd913.tar
ikiwiki-ffc99f5904934e6e7532bb8cfdebb44ad9ecd913.tar.gz
switch preprocess hooks to use error function
Diffstat (limited to 'IkiWiki/Plugin/edittemplate.pm')
-rw-r--r--IkiWiki/Plugin/edittemplate.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/IkiWiki/Plugin/edittemplate.pm b/IkiWiki/Plugin/edittemplate.pm
index 76c1cd42a..d1716a315 100644
--- a/IkiWiki/Plugin/edittemplate.pm
+++ b/IkiWiki/Plugin/edittemplate.pm
@@ -38,10 +38,10 @@ sub preprocess (@) { #{{{
return "" if $params{page} ne $params{destpage};
if (! exists $params{template} || ! length($params{template})) {
- return "[[meta ".gettext("template not specified")."]]";
+ error gettext("template not specified")
}
if (! exists $params{match} || ! length($params{match})) {
- return "[[meta ".gettext("match not specified")."]]";
+ error gettext("match not specified")
}
$pagestate{$params{page}}{edittemplate}{$params{match}}=$params{template};
@@ -108,7 +108,9 @@ sub filltemplate ($$) { #{{{
);
};
if ($@) {
- return "[[pagetemplate ".gettext("failed to process")." $@]]";
+ # Indicate that the earlier preprocessor directive set
+ # up a template that doesn't work.
+ return "[[!pagetemplate ".gettext("failed to process")." $@]]";
}
$template->param(name => $page);