From 67ebaf15d77cb00e0be16696c60860e7c61e827f Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 16 May 2013 22:20:56 -0400 Subject: [PATCH] theme: Now can be used in all templates when a theme is enabled. --- IkiWiki/Plugin/theme.pm | 9 +++++++++ debian/changelog | 2 ++ 2 files changed, 11 insertions(+) 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 diff --git a/debian/changelog b/debian/changelog index e6d39fa27..fb51569b3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ ikiwiki (3.20130505) UNRELEASED; urgency=low * Fix test suite to not fail when XML::Twig is not installed. Closes: #707436 + * theme: Now can be used in all templates when + a theme is enabled. -- Joey Hess Thu, 09 May 2013 10:47:18 -0400 -- 2.32.0.93.g670b81a890