X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/21b6fa937b11db46359a1a6aec85d33aca0551a8..002a97ffcdf347b8ad97210ddb5badacd3fee712:/IkiWiki/Plugin/theme.pm diff --git a/IkiWiki/Plugin/theme.pm b/IkiWiki/Plugin/theme.pm index ee94547e9..9b84ea7f0 100644 --- a/IkiWiki/Plugin/theme.pm +++ b/IkiWiki/Plugin/theme.pm @@ -9,6 +9,7 @@ sub import { hook(type => "getsetup", id => "theme", call => \&getsetup); hook(type => "checkconfig", id => "theme", call => \&checkconfig); hook(type => "needsbuild", id => "theme", call => \&needsbuild); + hook(type => "pagetemplate", id => "theme", call => \&pagetemplate); } sub getsetup () { @@ -63,4 +64,12 @@ sub needsbuild ($) { return $needsbuild; } +sub pagetemplate (@) { + my %params=@_; + my $template=$params{template}; + if (exists $config{theme} && length $config{theme}) { + $template->param("theme_$config{theme}" => 1); + } +} + 1