$pagemtime{$page}=$stat[9];
if (isinternal($page)) {
+ my $content = readfile($srcfile);
+
# Preprocess internal page in scan-only mode.
- preprocess($page, $page, readfile($srcfile), 1);
+ preprocess($page, $page, $content, 1);
+
+ run_hooks(scan => sub {
+ shift->(
+ page => $page,
+ content => $content,
+ );
+ });
+
push @internal_changed, $file;
}
else {
derender_internal($file);
}
+ run_hooks(build_affected => sub {
+ my %affected = shift->();
+ while (my ($page, $message) = each %affected) {
+ next unless exists $pagesources{$page};
+ render($pagesources{$page}, $message);
+ }
+ });
+
my ($backlinkchanged, $linkchangers)=calculate_changed_links($changed,
$del, $oldlink_targets);
run_hooks(delete => sub { shift->(@$del, @$internal_del) });
}
if (%rendered) {
- run_hooks(change => sub { shift->(keys %rendered) });
+ run_hooks(rendered => sub { shift->(keys %rendered) });
+ run_hooks(change => sub { shift->(keys %rendered) }); # back-compat
}
+ run_hooks(changes => sub {
+ shift->(@$new, @$changed, @$del,
+ @$internal_new, @$internal_changed, @$internal_del);
+ });
}
sub clean_rendered {