X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ffc99f5904934e6e7532bb8cfdebb44ad9ecd913..ee598e42f61a6afc31f49551a60dff9534f77ee1:/IkiWiki/Plugin/pagetemplate.pm?ds=inline diff --git a/IkiWiki/Plugin/pagetemplate.pm b/IkiWiki/Plugin/pagetemplate.pm index 205f5a9d7..60db8b327 100644 --- a/IkiWiki/Plugin/pagetemplate.pm +++ b/IkiWiki/Plugin/pagetemplate.pm @@ -7,12 +7,21 @@ use IkiWiki 2.00; my %templates; -sub import { #{{{ +sub import { + hook(type => "getsetup", id => "pagetemplate", call => \&getsetup); hook(type => "preprocess", id => "pagetemplate", call => \&preprocess); hook(type => "templatefile", id => "pagetemplate", call => \&templatefile); -} # }}} +} -sub preprocess (@) { #{{{ +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => undef, + }, +} + +sub preprocess (@) { my %params=@_; if (! exists $params{template} || @@ -26,9 +35,9 @@ sub preprocess (@) { #{{{ } return ""; -} # }}} +} -sub templatefile (@) { #{{{ +sub templatefile (@) { my %params=@_; if (exists $templates{$params{page}}) { @@ -36,6 +45,6 @@ sub templatefile (@) { #{{{ } return undef; -} # }}} +} 1