diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-07-02 19:06:08 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-07-02 19:06:08 +0000 |
commit | d1d212203c72072d9a42f66c171dc6be83225894 (patch) | |
tree | 5f640f3954402d5c94f596e41fb2856d68683f5c /IkiWiki/Plugin | |
parent | 2ed1419c1d469a3e018c2607ba47da525d97fa3a (diff) |
* Centralised all calls to HTML::Template and force all the templates
to be read as utf8.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/inline.pm | 19 | ||||
-rw-r--r-- | IkiWiki/Plugin/search.pm | 4 |
2 files changed, 10 insertions, 13 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm index 05563b946..afff96cee 100644 --- a/IkiWiki/Plugin/inline.pm +++ b/IkiWiki/Plugin/inline.pm @@ -40,8 +40,7 @@ sub preprocess_inline (@) { #{{{ if (exists $params{rootpage}) { # Add a blog post form, with a rss link button. - my $formtemplate=HTML::Template->new(blind_cache => 1, - filename => "$config{templatedir}/blogpost.tmpl"); + my $formtemplate=template("blogpost.tmpl", blind_cache => 1); $formtemplate->param(cgiurl => $config{cgiurl}); $formtemplate->param(rootpage => $params{rootpage}); if ($config{rss}) { @@ -51,16 +50,17 @@ sub preprocess_inline (@) { #{{{ } elsif ($config{rss}) { # Add a rss link button. - my $linktemplate=HTML::Template->new(blind_cache => 1, - filename => "$config{templatedir}/rsslink.tmpl"); + my $linktemplate=template("rsslink.tmpl", blind_cache => 1); $linktemplate->param(rssurl => rsspage(basename($params{page}))); $ret.=$linktemplate->output; } - my $template=HTML::Template->new(blind_cache => 1, - filename => (($params{archive} eq "no") - ? "$config{templatedir}/inlinepage.tmpl" - : "$config{templatedir}/inlinepagetitle.tmpl")); + my $template=template( + (($params{archive} eq "no") + ? "inlinepage.tmpl" + : "inlinepagetitle.tmpl"), + blind_cache => 1, + ); my @pages; foreach my $page (blog_list($params{pages}, $params{show})) { @@ -146,8 +146,7 @@ sub genrss ($@) { #{{{ my $url="$config{url}/".htmlpage($page); - my $template=HTML::Template->new(blind_cache => 1, - filename => "$config{templatedir}/rsspage.tmpl"); + my $template=template("rsspage.tmpl", blind_cache => 1); my @items; foreach my $p (@pages) { diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm index c94974ac4..94b37ca06 100644 --- a/IkiWiki/Plugin/search.pm +++ b/IkiWiki/Plugin/search.pm @@ -87,9 +87,7 @@ sub estcfg () { #{{{ close TEMPLATE; open(TEMPLATE, ">$estdir/$cgi.conf") || error("write $estdir/$cgi.conf: $!"); - my $template=HTML::Template->new( - filename => "$config{templatedir}/estseek.conf" - ); + my $template=template("estseek.conf"); eval q{use Cwd 'abs_path'}; $template->param( index => $estdir, |