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
-[[!tags patch]]
+[[!tag patch]]
#!/usr/bin/perl
package IkiWiki::Plugin::tmplvars;
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}) {
}
}
- } # }}}
+ }
- sub pagetemplate (@) { #{{{
+ sub pagetemplate (@) {
my %params=@_;
my $template = $params{template};
}
return undef;
- } # }}}
+ }
1