X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/a65d312467c5ab179ecf4aa715790f371a46634a..9db06329c98e1a390bbb6323de02dc7e2f45f1f8:/IkiWiki/Plugin/pagetemplate.pm?ds=sidebyside 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