aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-06-16 19:17:18 -0400
committerJoey Hess <joey@kitenet.net>2010-06-16 19:17:18 -0400
commit184f68efa88d6b8b4763ca18619b25e7d8ae1668 (patch)
treea9b27047c49246c694b1c465a05c15fe2dba81d5 /IkiWiki
parenteff5e233a2a3bf5e965c17734a3ad765c5fe9df5 (diff)
parentbc32754f1f1ca334078f788a346c27839e245cab (diff)
downloadikiwiki-184f68efa88d6b8b4763ca18619b25e7d8ae1668.tar
ikiwiki-184f68efa88d6b8b4763ca18619b25e7d8ae1668.tar.gz
Merge branch 'themes'
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/theme.pm37
-rw-r--r--IkiWiki/Plugin/wmd.pm1
2 files changed, 37 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/theme.pm b/IkiWiki/Plugin/theme.pm
new file mode 100644
index 000000000..ba6966381
--- /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 => 1,
+ },
+}
+
+my $added=0;
+sub checkconfig () {
+ if (! $added && exists $config{theme} && $config{theme} =~ /^\w+$/) {
+ add_underlay("themes/".$config{theme});
+ $added=1;
+ }
+}
+
+1
diff --git a/IkiWiki/Plugin/wmd.pm b/IkiWiki/Plugin/wmd.pm
index 99b136281..71d7c9d17 100644
--- a/IkiWiki/Plugin/wmd.pm
+++ b/IkiWiki/Plugin/wmd.pm
@@ -4,7 +4,6 @@ package IkiWiki::Plugin::wmd;
use warnings;
use strict;
use IkiWiki 3.00;
-use Encode;
sub import {
add_underlay("wmd");