- if ($template->query(name => 'commentslink')) {
- # XXX Would be nice to say how many comments there are in
- # the link. But, to update the number, blog pages
- # would have to update whenever comments of any inlines
- # page are added, which is not currently done.
- if ($shown) {
- $template->param(commentslink =>
- htmllink($page, $params{destpage}, $page,
- linktext => gettext("Comments"),
+ if ($template->query(name => 'commentslink')) {
+ my $num=num_comments($page, $config{srcdir});
+ my $link;
+ if ($num > 0) {
+ $link = htmllink($page, $params{destpage}, $page,
+ linktext => sprintf(ngettext("%i comment", "%i comments", $num), $num),