X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/7521dd6c7571cba4a3b882ecffc02dbcbed2805e..f7fc062a12dd18cb153ede4d574fd792bc996218:/IkiWiki/Plugin/comments.pm diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm index 3b8752894..fd9f0acb4 100644 --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -529,10 +529,11 @@ sub pagetemplate (@) { my $page = $params{page}; my $template = $params{template}; + my $shown = ($template->query(name => 'commentslink') || + $template->query(name => 'comments')) && + commentsshown($page); if ($template->query(name => 'comments')) { - my $shown = commentsshown($page); - my $comments = undef; if ($shown) { $comments = IkiWiki::preprocess_inline( @@ -563,7 +564,7 @@ sub pagetemplate (@) { # 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 (commentsshown($page)) { + if ($shown) { $template->param(commentslink => htmllink($page, $params{destpage}, $page, linktext => gettext("Comments"),