X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/cddc335b2bd98a302b261200c12d61b05476d727..f8cc87e8ee68d83eced465e90e9fd657646ad3c8:/IkiWiki/Plugin/version.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/version.pm b/IkiWiki/Plugin/version.pm index f96d2df06..3526dafde 100644 --- a/IkiWiki/Plugin/version.pm +++ b/IkiWiki/Plugin/version.pm @@ -6,12 +6,21 @@ use warnings; use strict; use IkiWiki 2.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, + }, +} + +sub needsbuild (@) { my $needsbuild=shift; foreach my $page (keys %pagestate) { if (exists $pagestate{$page}{version}{shown}) { @@ -27,11 +36,11 @@ sub needsbuild (@) { #{{{ } } } -} # }}} +} -sub preprocess (@) { #{{{ +sub preprocess (@) { my %params=@_; $pagestate{$params{destpage}}{version}{shown}=$IkiWiki::version; -} # }}} +} 1