diff options
author | Bernd Zeimetz <bernd@bzed.de> | 2008-06-21 21:51:04 +0200 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-06-21 16:23:39 -0400 |
commit | b16c43a44095c5c3dd2dd659e63a484280501758 (patch) | |
tree | 74a154cb858080dcba734a2be3fc11a12f43d42f | |
parent | 3542e5582b9df24db0d7bd6821e8090296c85149 (diff) | |
download | ikiwiki-b16c43a44095c5c3dd2dd659e63a484280501758.tar ikiwiki-b16c43a44095c5c3dd2dd659e63a484280501758.tar.gz |
`template` option for aggregate.pm.
Allows to specify the template file which is used to
create the html pages.
-rw-r--r-- | IkiWiki/Plugin/aggregate.pm | 9 | ||||
-rw-r--r-- | doc/plugins/aggregate.mdwn | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/aggregate.pm b/IkiWiki/Plugin/aggregate.pm index e44c26f74..b5354a823 100644 --- a/IkiWiki/Plugin/aggregate.pm +++ b/IkiWiki/Plugin/aggregate.pm @@ -154,6 +154,13 @@ sub preprocess (@) { #{{{ $feed->{updateinterval}=defined $params{updateinterval} ? $params{updateinterval} * 60 : 15 * 60; $feed->{expireage}=defined $params{expireage} ? $params{expireage} : 0; $feed->{expirecount}=defined $params{expirecount} ? $params{expirecount} : 0; + if (exists $params{template}) { + $params{template}=~s/[^-_a-zA-Z0-9]+//g; + } + else { + $params{template} = "aggregatepost" + } + $feed->{template}=$params{template} . ".tmpl"; delete $feed->{unseen}; $feed->{lastupdate}=0 unless defined $feed->{lastupdate}; $feed->{numposts}=0 unless defined $feed->{numposts}; @@ -507,7 +514,7 @@ sub add_page (@) { #{{{ $guid->{md5}=$digest; # Create the page. - my $template=template("aggregatepost.tmpl", blind_cache => 1); + my $template=template($feed->{template}, blind_cache => 1); $template->param(title => $params{title}) if defined $params{title} && length($params{title}); $template->param(content => htmlescape(htmlabs($params{content}, $feed->{feedurl}))); diff --git a/doc/plugins/aggregate.mdwn b/doc/plugins/aggregate.mdwn index aab5f079a..574c8b125 100644 --- a/doc/plugins/aggregate.mdwn +++ b/doc/plugins/aggregate.mdwn @@ -59,6 +59,8 @@ directive: * `tag` - A tag to tag each post from the feed with. A good tag to use is the name of the feed. Can be repeated multiple times. The [[tag]] plugin must be enabled for this to work. +* `template` - Template to use for creating the html pages. Defaults to + aggregatepost. Note that even if you are using subversion or another revision control system, pages created by aggregation will *not* be checked into revision |