+sub template_params (@) { #{{{
+ my $filename=shift;
+
+ require HTML::Template;
+ return filter => sub {
+ my $text_ref = shift;
+ $$text_ref=&Encode::decode_utf8($$text_ref);
+ },
+ filename => "$config{templatedir}/$filename", @_;
+} #}}}
+
+sub template ($;@) { #{{{
+ HTML::Template->new(template_params(@_));
+} #}}}
+