diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-03-14 06:40:58 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2006-03-14 06:40:58 +0000 |
commit | b8af4e74f73eaa8dc89c42731b801318df6709c9 (patch) | |
tree | 635f129294563ba96abee5266afed8458ee4e424 /ikiwiki | |
parent | b26de7676bf5d787172e97842e264ad5b1748bad (diff) |
add a special case for discussion pages when determining the links from a
page, since all pages implicitly link to their disussion page
Diffstat (limited to 'ikiwiki')
-rwxr-xr-x | ikiwiki | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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); |