X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/a65d312467c5ab179ecf4aa715790f371a46634a..e66e2c2a7e2fdf2d80c20e61854480342d3fa8b4:/IkiWiki/Plugin/template.pm?ds=sidebyside

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;