summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/inline.pm13
-rw-r--r--IkiWiki/Render.pm12
2 files changed, 16 insertions, 9 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 13ff0aa19..4bdb14032 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -156,11 +156,14 @@ sub preprocess_inline (@) { #{{{
if ($actions) {
my $file = $pagesources{$page};
my $type = pagetype($file);
- if ($config{discussion} &&
- $page !~ /.*\/discussion$/ &&
- (length $config{cgiurl} || exists $links{$page."/".gettext("discussion")})) {
- $template->param(have_actions => 1);
- $template->param(discussionlink => htmllink($page, $params{page}, "Discussion", 1, 1));
+ if ($config{discussion}) {
+ my $discussionlink=gettext("discussion");
+ if ($page !~ /.*\/\Q$discussionlink\E$/ &&
+ (length $config{cgiurl} ||
+ exists $links{$page."/".$discussionlink})) {
+ $template->param(have_actions => 1);
+ $template->param(discussionlink => htmllink($page, $params{page}, "Discussion", 1, 1));
+ }
}
if (length $config{cgiurl} && defined $type) {
$template->param(have_actions => 1);
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm
index 7ca9a3820..dcd107b81 100644
--- a/IkiWiki/Render.pm
+++ b/IkiWiki/Render.pm
@@ -93,10 +93,14 @@ sub genpage ($$$) { #{{{
$template->param(historyurl => $u);
$actions++;
}
- if ($config{discussion} && $page !~ /.*\/discussion$/ &&
- (length $config{cgiurl} || exists $links{$page."/".gettext("discussion")})) {
- $template->param(discussionlink => htmllink($page, $page, gettext("Discussion"), 1, 1));
- $actions++;
+ if ($config{discussion}) {
+ my $discussionlink=gettext("discussion");
+ if ($page !~ /.*\/\Q$discussionlink\E$/ &&
+ (length $config{cgiurl} ||
+ exists $links{$page."/".$discussionlink})) {
+ $template->param(discussionlink => htmllink($page, $page, gettext("Discussion"), 1, 1));
+ $actions++;
+ }
}
if ($actions) {