aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki.pm
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2014-02-21 21:10:43 +0000
committerSimon McVittie <smcv@debian.org>2014-03-05 10:42:19 +0000
commitcbb3218db762341a1eafbf2892cb100755772f78 (patch)
tree329413e0f07c889645b6241a05fe8d7909d77d5b /IkiWiki.pm
parentcad753baf9b25ddd8e4cb5454766fce1cdc4217a (diff)
downloadikiwiki-cbb3218db762341a1eafbf2892cb100755772f78.tar
ikiwiki-cbb3218db762341a1eafbf2892cb100755772f78.tar.gz
add readtemplate hook
Diffstat (limited to 'IkiWiki.pm')
-rw-r--r--IkiWiki.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/IkiWiki.pm b/IkiWiki.pm
index e5da04a3b..5e17c4a73 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -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,