add readtemplate hook
[ikiwiki.git] / IkiWiki.pm
index e5da04a3bb86d8aa47d96cac3df679623ad707ee..5e17c4a738a62422ed5a7a1ab613105bb6b02bb9 100644 (file)
@@ -2021,11 +2021,19 @@ sub template_depends ($$;@) {
        if (defined $page && defined $tpage) {
                add_depends($page, $tpage);
        }
-       
+
        my @opts=(
                filter => sub {
                        my $text_ref = shift;
                        ${$text_ref} = decode_utf8(${$text_ref});
+                       run_hooks(readtemplate => sub {
+                               ${$text_ref} = shift->(
+                                       id => $name,
+                                       page => $tpage,
+                                       content => ${$text_ref},
+                                       untrusted => $untrusted,
+                               );
+                       });
                },
                loop_context_vars => 1,
                die_on_bad_params => 0,