diff options
Diffstat (limited to 'IkiWiki')
-rw-r--r-- | IkiWiki/Plugin/skeleton.pm | 5 | ||||
-rw-r--r-- | IkiWiki/Render.pm | 21 |
2 files changed, 17 insertions, 9 deletions
diff --git a/IkiWiki/Plugin/skeleton.pm b/IkiWiki/Plugin/skeleton.pm index b8c327c9d..fb4cfe9af 100644 --- a/IkiWiki/Plugin/skeleton.pm +++ b/IkiWiki/Plugin/skeleton.pm @@ -11,6 +11,7 @@ use IkiWiki 2.00; sub import { #{{{ hook(type => "getopt", id => "skeleton", call => \&getopt); hook(type => "checkconfig", id => "skeleton", call => \&checkconfig); + hook(type => "needsbuild", id => "skeleton", call => \&needsbuild); hook(type => "preprocess", id => "skeleton", call => \&preprocess); hook(type => "filter", id => "skeleton", call => \&filter); hook(type => "htmlize", id => "skeleton", call => \&htmlize); @@ -35,6 +36,10 @@ sub checkconfig () { #{{{ debug("skeleton plugin checkconfig"); } #}}} +sub needsbuild () { #{{{ + debug("skeleton plugin needsbuild"); +} #}}} + sub preprocess (@) { #{{{ my %params=@_; diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 0b7e00d9d..37383384d 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -318,8 +318,8 @@ sub refresh () { #{{{ } } - # scan changed and new files - my @changed; + # find changed and new files + my @needsbuild; foreach my $file (@files) { my $page=pagename($file); @@ -327,16 +327,19 @@ sub refresh () { #{{{ if (! exists $pagemtime{$page} || $mtime > $pagemtime{$page} || $forcerebuild{$page}) { - debug(sprintf(gettext("scanning %s"), $file)); - $pagemtime{$page}=$mtime; - push @changed, $file; - scan($file); + $pagemtime{$page}=$mtime; + push @needsbuild, $file; } } - calculate_backlinks(); + run_hooks(needsbuild => sub { shift->(\@needsbuild) }); - # render changed and new pages - foreach my $file (@changed) { + # scan and rendder files + foreach my $file (@needsbuild) { + debug(sprintf(gettext("scanning %s"), $file)); + scan($file); + } + calculate_backlinks(); + foreach my $file (@needsbuild) { debug(sprintf(gettext("rendering %s"), $file)); render($file); $rendered{$file}=1; |