]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Render.pm
update
[ikiwiki.git] / IkiWiki / Render.pm
index 47fbe7a61083eba6cb0f0bd08efe8623ddb0745a..86396420736a8e7120815da60b579e9781b8b0cb 100644 (file)
@@ -93,7 +93,7 @@ sub genpage ($$$) { #{{{
                $template->param(historyurl => $u);
                $actions++;
        }
                $template->param(historyurl => $u);
                $actions++;
        }
-       if ($config{discussion}) {
+       if ($config{discussion} && (length $config{cgiurl} || exists $links{"$page/discussion"})) {
                $template->param(discussionlink => htmllink($page, $page, "Discussion", 1, 1));
                $actions++;
        }
                $template->param(discussionlink => htmllink($page, $page, "Discussion", 1, 1));
                $actions++;
        }
@@ -155,8 +155,8 @@ sub scan ($) { #{{{
                        push @links, titlepage($2);
                }
                if ($config{discussion}) {
                        push @links, titlepage($2);
                }
                if ($config{discussion}) {
-                       # Discussion links are a special case since they're not in the
-                       # text of the page, but on its template.
+                       # Discussion links are a special case since they're
+                       # not in the text of the page, but on its template.
                        push @links, "$page/discussion";
                }
                $links{$page}=\@links;
                        push @links, "$page/discussion";
                }
                $links{$page}=\@links;
@@ -218,7 +218,7 @@ sub refresh () { #{{{
                no_chdir => 1,
                wanted => sub {
                        $_=decode_utf8($_);
                no_chdir => 1,
                wanted => sub {
                        $_=decode_utf8($_);
-                       if (/$config{wiki_file_prune_regexp}/) {
+                       if (file_pruned($_, $config{srcdir})) {
                                $File::Find::prune=1;
                        }
                        elsif (! -d $_ && ! -l $_) {
                                $File::Find::prune=1;
                        }
                        elsif (! -d $_ && ! -l $_) {
@@ -238,7 +238,7 @@ sub refresh () { #{{{
                no_chdir => 1,
                wanted => sub {
                        $_=decode_utf8($_);
                no_chdir => 1,
                wanted => sub {
                        $_=decode_utf8($_);
-                       if (/$config{wiki_file_prune_regexp}/) {
+                       if (file_pruned($_, $config{underlaydir})) {
                                $File::Find::prune=1;
                        }
                        elsif (! -d $_ && ! -l $_) {
                                $File::Find::prune=1;
                        }
                        elsif (! -d $_ && ! -l $_) {