]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Render.pm
* The page name and parent links has switched from using a <h1> to a styled
[git.ikiwiki.info.git] / IkiWiki / Render.pm
index 9feaa6da7636b46940a101f9bbfbaf87aebde496..b59a721c0408d398e367ca320cb28b5265e9d2f5 100644 (file)
@@ -174,7 +174,15 @@ sub genpage ($$$) { #{{{
                $u=~s/\[\[file\]\]/$pagesources{$page}/g;
                $template->param(historyurl => $u);
        }
-       $template->param(headercontent => $config{headercontent});
+       if ($config{discussion}) {
+               $template->param(discussionlink => htmllink($page, "Discussion", 1, 1));
+       }
+
+       if (exists $hooks{pagetemplate}) {
+               foreach my $id (keys %{$hooks{pagetemplate}}) {
+                       $hooks{pagetemplate}{$id}{call}->($page, $template);
+               }
+       }
 
        $template->param(
                title => $title,
@@ -182,7 +190,6 @@ sub genpage ($$$) { #{{{
                parentlinks => [parentlinks($page)],
                content => $content,
                backlinks => [backlinks($page)],
-               discussionlink => htmllink($page, "Discussion", 1, 1),
                mtime => scalar(gmtime($mtime)),
                styleurl => styleurl($page),
        );
@@ -218,9 +225,14 @@ sub findlinks ($$) { #{{{
        while ($content =~ /(?<!\\)$config{wiki_link_regexp}/g) {
                push @links, titlepage($2);
        }
-       # Discussion links are a special case since they're not in the text
-       # of the page, but on its template.
-       return @links, "$page/discussion";
+       if ($config{discussion}) {
+               # Discussion links are a special case since they're not in the
+               # text of the page, but on its template.
+               return @links, "$page/discussion";
+       }
+       else {
+               return @links;
+       }
 } #}}}
 
 sub render ($) { #{{{