aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@gnu.kitenet.net>2010-02-14 18:09:28 -0500
committerJoey Hess <joey@gnu.kitenet.net>2010-02-14 18:09:28 -0500
commit9a0b9bdc88c1b47c14ad0b587c93bbac400e61ac (patch)
treefb906b79389c3483a6075a51f2fb489847bdd37b
parentf1183cbf0c9c09725192dcc8384381f9112ae222 (diff)
downloadikiwiki-9a0b9bdc88c1b47c14ad0b587c93bbac400e61ac.tar
ikiwiki-9a0b9bdc88c1b47c14ad0b587c93bbac400e61ac.tar.gz
minor refactor/optimisation
-rw-r--r--IkiWiki/Plugin/comments.pm12
1 files changed, 4 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/comments.pm b/IkiWiki/Plugin/comments.pm
index 1e71749a4..5bcf4a981 100644
--- a/IkiWiki/Plugin/comments.pm
+++ b/IkiWiki/Plugin/comments.pm
@@ -742,28 +742,24 @@ sub pagetemplate (@) {
}
}
- if ($template->query(name => 'commentsurl')) {
- if ($shown) {
+ if ($shown) {
+ if ($template->query(name => 'commentsurl')) {
$template->param(commentsurl =>
urlto($page, undef, 1).'#comments');
}
- }
- if ($template->query(name => 'atomcommentsurl') && $config{usedirs}) {
- if ($shown) {
+ if ($template->query(name => 'atomcommentsurl') && $config{usedirs}) {
# This will 404 until there are some comments, but I
# think that's probably OK...
$template->param(atomcommentsurl =>
urlto($page, undef, 1).'comments.atom');
}
- }
- 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) {
+ if ($template->query(name => 'commentslink')) {
$template->param(commentslink =>
htmllink($page, $params{destpage}, $page,
linktext => gettext("Comments"),