X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/f92505d78b82c6ac146e43054ebd12441575a602..7517d34da928bb9612c65fcde87cc434b7b7d653:/IkiWiki/Plugin/version.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/version.pm b/IkiWiki/Plugin/version.pm index f96d2df06..c13643478 100644 --- a/IkiWiki/Plugin/version.pm +++ b/IkiWiki/Plugin/version.pm @@ -4,14 +4,24 @@ package IkiWiki::Plugin::version; use warnings; use strict; -use IkiWiki 2.00; +use IkiWiki 3.00; -sub import { #{{{ +sub import { + hook(type => "getsetup", id => "version", call => \&getsetup); hook(type => "needsbuild", id => "version", call => \&needsbuild); hook(type => "preprocess", id => "version", call => \&preprocess); -} # }}} +} -sub needsbuild (@) { #{{{ +sub getsetup () { + return + plugin => { + safe => 1, + rebuild => undef, + section => "widget", + }, +} + +sub needsbuild (@) { my $needsbuild=shift; foreach my $page (keys %pagestate) { if (exists $pagestate{$page}{version}{shown}) { @@ -27,11 +37,11 @@ sub needsbuild (@) { #{{{ } } } -} # }}} +} -sub preprocess (@) { #{{{ +sub preprocess (@) { my %params=@_; $pagestate{$params{destpage}}{version}{shown}=$IkiWiki::version; -} # }}} +} 1