]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/sidebar.pm
avoid mixing english with translation
[git.ikiwiki.info.git] / IkiWiki / Plugin / sidebar.pm
index da1f82b82ba87365c902337718d1b29ecc7ffde9..41812e1c1f671da84be1a06a5821695fc5dc6f11 100644 (file)
@@ -6,13 +6,22 @@ package IkiWiki::Plugin::sidebar;
 
 use warnings;
 use strict;
-use IkiWiki;
+use IkiWiki 3.00;
 
-sub import { #{{{
+sub import {
+       hook(type => "getsetup", id => "sidebar", call => \&getsetup);
        hook(type => "pagetemplate", id => "sidebar", call => \&pagetemplate);
-} # }}}
+}
 
-sub sidebar_content ($) { #{{{
+sub getsetup () {
+       return
+               plugin => {
+                       safe => 1,
+                       rebuild => 1,
+               },
+}
+
+sub sidebar_content ($) {
        my $page=shift;
        
        my $sidebar_page=bestlink($page, "sidebar") || return;
@@ -27,15 +36,15 @@ sub sidebar_content ($) { #{{{
 
                my $content=readfile(srcfile($sidebar_file));
                return unless length $content;
-               return IkiWiki::htmlize($page, $sidebar_type,
+               return IkiWiki::htmlize($sidebar_page, $page, $sidebar_type,
                       IkiWiki::linkify($sidebar_page, $page,
                       IkiWiki::preprocess($sidebar_page, $page,
-                      IkiWiki::filter($sidebar_page, $content))));
+                      IkiWiki::filter($sidebar_page, $page, $content))));
        }
 
-} # }}}
+}
 
-sub pagetemplate (@) { #{{{
+sub pagetemplate (@) {
        my %params=@_;
 
        my $page=$params{page};
@@ -47,6 +56,6 @@ sub pagetemplate (@) { #{{{
                        $template->param(sidebar => $content);
                }
        }
-} # }}}
+}
 
 1