summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-06-16 15:43:42 -0400
committerJoey Hess <joey@kitenet.net>2010-06-16 15:43:42 -0400
commit062ed44f47d61c3bbbf2e8a7944a9b4e423b735a (patch)
tree9b3624aea731a7c30981305e4babf8cf4d0d6d28 /IkiWiki/Plugin
parenta748f283ace7ff83ac4630674d58767fd2540d8a (diff)
add theme plugin
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/theme.pm37
1 files changed, 37 insertions, 0 deletions
diff --git a/IkiWiki/Plugin/theme.pm b/IkiWiki/Plugin/theme.pm
new file mode 100644
index 000000000..5e6e4b092
--- /dev/null
+++ b/IkiWiki/Plugin/theme.pm
@@ -0,0 +1,37 @@
+#!/usr/bin/perl
+package IkiWiki::Plugin::theme;
+
+use warnings;
+use strict;
+use IkiWiki 3.00;
+
+sub import {
+ hook(type => "getsetup", id => "theme", call => \&getsetup);
+ hook(type => "checkconfig", id => "theme", call => \&checkconfig);
+}
+
+sub getsetup () {
+ return
+ plugin => {
+ safe => 1,
+ rebuild => 0,
+ section => "web",
+ },
+ theme => {
+ type => "string",
+ example => "actiontabs",
+ description => "name of theme to enable",
+ safe => 1,
+ rebuild => 0,
+ },
+}
+
+my $added=0;
+sub checkconfig () {
+ if (! $added && exists $config{theme} && $config{theme} =~ /^\w+$/) {
+ add_underlay("themes/".$config{theme});
+ $added=1;
+ }
+}
+
+1