2 # Ikiwiki version plugin.
3 package IkiWiki::Plugin::version;
10 hook(type => "needsbuild", id => "version", call => \&needsbuild);
11 hook(type => "preprocess", id => "version", call => \&preprocess);
14 sub needsbuild (@) { #{{{
16 foreach my $page (keys %pagestate) {
17 if (exists $pagestate{$page}{version}{shown}) {
18 if ($pagestate{$page}{version}{shown} ne $IkiWiki::version) {
19 push @$needsbuild, $pagesources{$page};
21 if (grep { $_ eq $pagesources{$page} } @$needsbuild) {
22 # remove state, will be re-added if
23 # the version is still shown during the
25 delete $pagestate{$page}{version}{shown};
31 sub preprocess (@) { #{{{
33 $pagestate{$params{destpage}}{version}{shown}=$IkiWiki::version;