diff options
author | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-07-26 20:50:55 +0000 |
---|---|---|
committer | joey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071> | 2007-07-26 20:50:55 +0000 |
commit | 40959ce76d159cefaf0431ad2cc61ad35a9f99b1 (patch) | |
tree | a30b415dbb712912fd45584b9861bb680562aba7 /IkiWiki/Render.pm | |
parent | e64442aa08c1d368f0ab3284016b0addb3ac4a67 (diff) | |
download | ikiwiki-40959ce76d159cefaf0431ad2cc61ad35a9f99b1.tar ikiwiki-40959ce76d159cefaf0431ad2cc61ad35a9f99b1.tar.gz |
* Add templatefile hook.
* Add pagetemplate plugin, which allows changing the template used for
a page. (Not to be confused with the hook of the same name..)
Diffstat (limited to 'IkiWiki/Render.pm')
-rw-r--r-- | IkiWiki/Render.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 911e9c273..a95da40d2 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -69,7 +69,15 @@ sub genpage ($$$) { #{{{ my $content=shift; my $mtime=shift; - my $template=template("page.tmpl", blind_cache => 1); + my $templatefile; + run_hooks(templatefile => sub { + return if defined $templatefile; + my $file=shift->(page => $page); + if (defined $file && defined template_file($file)) { + $templatefile=$file; + } + }); + my $template=template(defined $templatefile ? $templatefile : 'page.tmpl', blind_cache => 1); my $actions=0; if (length $config{cgiurl}) { |