]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/template.pm
img: Support sizes like 200x. Closes: #475149
[git.ikiwiki.info.git] / IkiWiki / Plugin / template.pm
index aa1f57c0703ebcea645bb8818ef779ffaa520d1c..a2859b2a99864ddb0e9d33cea8106b46ffbc8775 100644 (file)
@@ -9,14 +9,23 @@ use HTML::Template;
 use Encode;
 
 sub import { #{{{
+       hook(type => "getsetup", id => "template", call => \&getsetup);
        hook(type => "preprocess", id => "template", call => \&preprocess);
 } # }}}
 
+sub getsetup () { #{{{
+       return
+               plugin => {
+                       safe => 1,
+                       rebuild => undef,
+               },
+} #}}}
+
 sub preprocess (@) { #{{{
        my %params=@_;
 
        if (! exists $params{id}) {
-               return "[[template ".gettext("missing id parameter")."]]";
+               error gettext("missing id parameter")
        }
 
        my $template_page="templates/$params{id}";
@@ -42,7 +51,7 @@ sub preprocess (@) { #{{{
                );
        };
        if ($@) {
-               return "[[template ".gettext("failed to process:")." $@]]";
+               error gettext("failed to process:")." $@"
        }
 
        $params{basename}=IkiWiki::basename($params{page});