X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/a65d312467c5ab179ecf4aa715790f371a46634a..6a986a8a0bd20e82e128ce7e0aa9587437ae8325:/IkiWiki/Plugin/template.pm diff --git a/IkiWiki/Plugin/template.pm b/IkiWiki/Plugin/template.pm index c33dbbb83..c980df48f 100644 --- a/IkiWiki/Plugin/template.pm +++ b/IkiWiki/Plugin/template.pm @@ -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;