X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/57e56828f5b03f8fb31631f36731f989d4335607..7aa10a2952a0d0ee8543f575966f7e4a780c993c:/IkiWiki/Plugin/theme.pm 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