summaryrefslogtreecommitdiff
path: root/ikiwiki
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-03-14 06:40:58 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-03-14 06:40:58 +0000
commitb8af4e74f73eaa8dc89c42731b801318df6709c9 (patch)
tree635f129294563ba96abee5266afed8458ee4e424 /ikiwiki
parentb26de7676bf5d787172e97842e264ad5b1748bad (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-xikiwiki9
1 files changed, 6 insertions, 3 deletions
diff --git a/ikiwiki b/ikiwiki
index 1c16b6725..ad3e06b3f 100755
--- 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);