my $rss=(($config{rss} || $config{allowrss}) && exists $params{rss}) ? yesno($params{rss}) : $config{rss};
my $atom=(($config{atom} || $config{allowatom}) && exists $params{atom}) ? yesno($params{atom}) : $config{atom};
my $quick=exists $params{quick} ? yesno($params{quick}) : 0;
- my $feeds=exists $params{feeds} ? yesno($params{feeds}) : !$quick;
+ my $feeds=! $nested && (exists $params{feeds} ? yesno($params{feeds}) : !$quick);
my $emptyfeeds=exists $params{emptyfeeds} ? yesno($params{emptyfeeds}) : 1;
my $feedonly=yesno($params{feedonly});
if (! exists $params{show} && ! $archive) {
if ($params{feedshow} && $num < $params{feedshow}) {
$num=$params{feedshow};
}
- if ($params{skip}) {
+ if ($params{skip} && $num) {
$num+=$params{skip};
}
- @list = use_pagespec($params{page}, $params{pages},
+ @list = pagespec_match_list($params{page}, $params{pages},
deptype => deptype($quick ? "presence" : "content"),
- limit => sub { $_[0] ne $params{page} },
+ filter => sub { $_[0] eq $params{page} },
sort => exists $params{sort} ? $params{sort} : "age",
reverse => yesno($params{reverse}),
- num => $num,
+ ($num ? (num => $num) : ()),
);
}
}
if ($feeds && exists $params{feedpages}) {
- @feedlist = use_pagespec($params{page}, $params{feedpages},
- list => \@feedlist);
+ @feedlist = pagespec_match_list(
+ $params{page}, "($params{pages}) and ($params{feedpages})",
+ deptype => deptype($quick ? "presence" : "content"),
+ list => \@feedlist,
+ );
}
my ($feedbase, $feednum);
error sprintf(gettext("nonexistant template %s"), $params{template});
}
my $template=HTML::Template->new(@params) unless $raw;
+ my $needcontent=$raw || (!($archive && $quick) && $template->query(name => 'content'));
foreach my $page (@list) {
my $file = $pagesources{$page};
my $type = pagetype($file);
- if (! $raw || ($raw && ! defined $type)) {
- unless ($archive && $quick) {
+ if (! $raw) {
+ if ($needcontent) {
# Get the content before populating the
# template, since getting the content uses
# the same template if inlines are nested.
filter($page, $params{destpage},
readfile(srcfile($file)))));
}
+ else {
+ $ret.="\n".
+ readfile(srcfile($file));
+ }
}
}
}