X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/57e56828f5b03f8fb31631f36731f989d4335607..c3e7194db09540287cbe4cff7800e111339f0459:/IkiWiki/Plugin/theme.pm?ds=sidebyside diff --git a/IkiWiki/Plugin/theme.pm b/IkiWiki/Plugin/theme.pm index 03b0816ed..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 () { @@ -60,6 +61,15 @@ sub needsbuild ($) { $wikistate{theme}{currenttheme}=$config{theme}; } + return $needsbuild; +} + +sub pagetemplate (@) { + my %params=@_; + my $template=$params{template}; + if (exists $config{theme} && length $config{theme}) { + $template->param("theme_$config{theme}" => 1); + } } 1