]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/template.pm
po(match_lang, match_currentlang): use the lang() function
[git.ikiwiki.info.git] / IkiWiki / Plugin / template.pm
index c33dbbb83b8d1623ffd1348667247ec3be04f082..c980df48f4a48dfa8100fefa341740a2028244eb 100644 (file)
@@ -9,9 +9,18 @@ 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=@_;
 
@@ -24,7 +33,7 @@ sub preprocess (@) { #{{{
 
        my $template_file=$pagesources{$template_page};
        return sprintf(gettext("template %s not found"),
-               htmllink($params{page}, $params{destpage}, $template_page))
+               htmllink($params{page}, $params{destpage}, "/".$template_page))
                        unless defined $template_file;
 
        my $template;