X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/1dddec0ba9f66f082f4b8349916cdb6bdb5636e3..eec38e8eeb63f6a93c60fc7b9e7e23b28e3b13e8:/IkiWiki/Plugin/sidebar.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/sidebar.pm b/IkiWiki/Plugin/sidebar.pm index 7c2e6e1f6..41812e1c1 100644 --- a/IkiWiki/Plugin/sidebar.pm +++ b/IkiWiki/Plugin/sidebar.pm @@ -6,13 +6,22 @@ package IkiWiki::Plugin::sidebar; use warnings; use strict; -use IkiWiki 2.00; +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; @@ -33,9 +42,9 @@ sub sidebar_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