]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/version.pm
Remember to run all the tests before committing!
[git.ikiwiki.info.git] / IkiWiki / Plugin / version.pm
index f96d2df06ce345d9939c356637e6e6d0e2d06e8b..fc265526c15e41682efec8c7702d3a54e5efcf17 100644 (file)
@@ -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,12 @@ sub needsbuild (@) { #{{{
                        }
                }
        }
-} # }}}
+       return $needsbuild;
+}
 
-sub preprocess (@) { #{{{
+sub preprocess (@) {
        my %params=@_;
        $pagestate{$params{destpage}}{version}{shown}=$IkiWiki::version;
-} # }}}
+}
 
 1