X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/8a6f4a7e50c247c061fd74b535d0f292aca6bda7..062b196f51bcca07c42b79b01e0075cf68a65157:/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