summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--IkiWiki/Plugin/comments.pm7
-rw-r--r--templates/page.tmpl4
2 files changed, 8 insertions, 3 deletions
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"),
diff --git a/templates/page.tmpl b/templates/page.tmpl
index 79c2b8b6e..21abc979d 100644
--- a/templates/page.tmpl
+++ b/templates/page.tmpl
@@ -49,9 +49,13 @@
<TMPL_IF NAME="PREFSURL">
<li><a href="<TMPL_VAR PREFSURL>">Preferences</a></li>
</TMPL_IF>
+<TMPL_IF NAME="COMMENTSLINK">
+<li><TMPL_VAR COMMENTSLINK><br /></li>
+<TMPL_ELSE>
<TMPL_IF NAME="DISCUSSIONLINK">
<li><TMPL_VAR DISCUSSIONLINK><br /></li>
</TMPL_IF>
+</TMPL_IF>
</ul>
</div>
</TMPL_IF>