add a special case for discussion pages when determining the links from a
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 14 Mar 2006 06:40:58 +0000 (06:40 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 14 Mar 2006 06:40:58 +0000 (06:40 +0000)
page, since all pages implicitly link to their disussion page

ikiwiki

diff --git a/ikiwiki b/ikiwiki
index 1c16b67258d1cc9fb776df620d12b6cd53095695..ad3e06b3fca2ae884e339d0cc0ef228791f03d05 100755 (executable)
--- a/ikiwiki
+++ b/ikiwiki
@@ -165,14 +165,17 @@ sub writefile ($$) { #{{{
        close OUT;
 } #}}}
 
-sub findlinks ($) { #{{{
+sub findlinks ($$) { #{{{
        my $content=shift;
+       my $page=shift;
 
        my @links;
        while ($content =~ /(?<!\\)$config{wiki_link_regexp}/g) {
                push @links, lc($1);
        }
-       return @links;
+       # Discussion links are a special case since they're not in the text
+       # of the page, but on its template.
+       return @links, "$page/discussion";
 } #}}}
 
 sub bestlink ($$) { #{{{
@@ -377,7 +380,7 @@ sub render ($) { #{{{
        if ($type ne 'unknown') {
                my $page=pagename($file);
                
-               $links{$page}=[findlinks($content)];
+               $links{$page}=[findlinks($content, $page)];
                
                $content=linkify($content, $file);
                $content=htmlize($type, $content);