-sub genrss ($$$) { #{{{
- my $content=shift;
- my $page=shift;
- my $mtime=shift;
-
- my $url="$config{url}/".htmlpage($page);
-
- my $template=HTML::Template->new(blind_cache => 1,
- filename => "$config{templatedir}/rsspage.tmpl");
-
- my @items;
- my $isblog=0;
- my $gen_blog=sub {
- my $parentpage=shift;
- my %params=@_;
-
- if (! exists $params{show}) {
- $params{show}=10;
- }
- if (! exists $params{pages}) {
- return "";
- }
- $inlinepages{$parentpage}=$params{pages};
-
- $isblog=1;
- foreach my $page (blog_list($params{pages}, $params{show})) {
- push @items, {
- itemtitle => pagetitle(basename($page)),
- itemurl => "$config{url}/$renderedfiles{$page}",
- itempubdate => date_822($pagectime{$page}),
- itemcontent => absolute_urls(get_inline_content($parentpage, $page), $url),
- } if exists $renderedfiles{$page};
- }
-
- return "";
- };
-
- $content = postprocess($page, $content, inline => $gen_blog);
-
- # Regular page gets a feed that is updated every time the
- # page is changed, so the mtime is encoded in the guid.
- push @items, {
- itemtitle => pagetitle(basename($page)),
- itemguid => "$url?mtime=$mtime",
- itemurl => $url,
- itempubdate => date_822($mtime),
- itemcontent => absolute_urls($content, $url),
- } unless $isblog;
-
- $template->param(
- title => $config{wikiname},
- pageurl => $url,
- items => \@items,
- );
-
- return $template->output;
-} #}}}