aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/theme.pm
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2013-05-16 22:20:56 -0400
committerJoey Hess <joey@kitenet.net>2013-05-16 22:20:56 -0400
commit67ebaf15d77cb00e0be16696c60860e7c61e827f (patch)
tree77e88606a68f0bc184be0f080715a50b79f41b38 /IkiWiki/Plugin/theme.pm
parent9addf2b57e31a4a8960f0ff66a32d350f58a2d63 (diff)
downloadikiwiki-67ebaf15d77cb00e0be16696c60860e7c61e827f.tar
ikiwiki-67ebaf15d77cb00e0be16696c60860e7c61e827f.tar.gz
theme: Now <TMPL_IF THEME_$NAME> can be used in all templates when a theme is enabled.
Diffstat (limited to 'IkiWiki/Plugin/theme.pm')
-rw-r--r--IkiWiki/Plugin/theme.pm9
1 files changed, 9 insertions, 0 deletions
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