X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/b339a9ebac97389454db8fa0c2c55eea7aa7137d..c5642119f7fafdafdaff05c0d37e787de221e9e2:/doc/todo/tmplvars_plugin.mdwn?ds=inline diff --git a/doc/todo/tmplvars_plugin.mdwn b/doc/todo/tmplvars_plugin.mdwn index b944fb8f6..644cf23aa 100644 --- a/doc/todo/tmplvars_plugin.mdwn +++ b/doc/todo/tmplvars_plugin.mdwn @@ -1,5 +1,7 @@ A simple plugin to allow per-page customization of a template by passing paramaters to HTML::Template. For those times when a whole pagetemplate is too much work. --Ethan +[[!tag patch]] + #!/usr/bin/perl package IkiWiki::Plugin::tmplvars; @@ -9,12 +11,12 @@ A simple plugin to allow per-page customization of a template by passing paramat my %tmplvars; - sub import { #{{{ + sub import { hook(type => "preprocess", id => "tmplvars", call => \&preprocess); hook(type => "pagetemplate", id => "tmplvars", call => \&pagetemplate); - } # }}} + } - sub preprocess (@) { #{{{ + sub preprocess (@) { my %params=@_; if ($params{page} eq $params{destpage}) { @@ -32,9 +34,9 @@ A simple plugin to allow per-page customization of a template by passing paramat } } - } # }}} + } - sub pagetemplate (@) { #{{{ + sub pagetemplate (@) { my %params=@_; my $template = $params{template}; @@ -45,6 +47,6 @@ A simple plugin to allow per-page customization of a template by passing paramat } return undef; - } # }}} + } 1