- if ($feeds && $rss) {
- will_render($params{page}, rsspage($params{page}));
- writefile(rsspage($params{page}), $config{destdir},
- genfeed("rss", $rssurl, $desc, $params{page}, @list));
- $toping{$params{page}}=1 unless $config{rebuild};
- $feedlinks{$params{destpage}}=qq{<link rel="alternate" type="application/rss+xml" title="RSS" href="$rssurl" />};
- }
- if ($feeds && $atom) {
- will_render($params{page}, atompage($params{page}));
- writefile(atompage($params{page}), $config{destdir},
- genfeed("atom", $atomurl, $desc, $params{page}, @list));
- $toping{$params{page}}=1 unless $config{rebuild};
- $feedlinks{$params{destpage}}=qq{<link rel="alternate" type="application/atom+xml" title="Atom" href="$atomurl" />};
+ if ($feeds) {
+ if (exists $params{feedshow} && @list > $params{feedshow}) {
+ @list=@list[0..$params{feedshow} - 1];
+ }
+ if (exists $params{feedpages}) {
+ @list=grep { pagespec_match($_, $params{feedpages}, location => $params{page}) } @list;
+ }
+
+ if ($rss) {
+ my $rssp=rsspage($params{page});
+ will_render($params{page}, $rssp);
+ writefile($rssp, $config{destdir},
+ genfeed("rss", $rssurl, $desc, $params{page}, @list));
+ $toping{$params{page}}=1 unless $config{rebuild};
+ $feedlinks{$params{destpage}}=qq{<link rel="alternate" type="application/rss+xml" title="RSS" href="$rssurl" />};
+ }
+ if ($atom) {
+ my $atomp=atompage($params{page});
+ will_render($params{page}, $atomp);
+ writefile($atomp, $config{destdir},
+ genfeed("atom", $atomurl, $desc, $params{page}, @list));
+ $toping{$params{page}}=1 unless $config{rebuild};
+ $feedlinks{$params{destpage}}=qq{<link rel="alternate" type="application/atom+xml" title="Atom" href="$atomurl" />};
+ }