From 7ea8df24b32a36687cfea94e2b84272777562325 Mon Sep 17 00:00:00 2001 From: joey Date: Mon, 3 Jul 2006 21:29:56 +0000 Subject: * Introduce add_plugins and disable_plugins config options in setup files. This allows adding or removing plugins w/o overriding the whole list of default plugins, which makes it easier to upgrade when new default plugins are added. --- IkiWiki/Setup/Standard.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'IkiWiki/Setup') diff --git a/IkiWiki/Setup/Standard.pm b/IkiWiki/Setup/Standard.pm index 786ba70ac..d42ceffa0 100644 --- a/IkiWiki/Setup/Standard.pm +++ b/IkiWiki/Setup/Standard.pm @@ -19,6 +19,18 @@ package IkiWiki; sub setup_standard { my %setup=%{$_[1]}; + $setup{plugin}=$config{plugin}; + if (exists $setup{add_plugins}) { + push @{$setup{plugin}}, @{$setup{add_plugins}}; + delete $setup{add_plugins}; + } + if (exists $setup{disable_plugins}) { + foreach my $plugin (@{$setup{disable_plugins}}) { + $setup{plugin}=[grep { $_ ne $plugin } @{$setup{plugin}}]; + } + delete $setup{disable_plugins}; + } + if (! $config{refresh}) { debug("generating wrappers.."); my @wrappers=@{$setup{wrappers}}; -- cgit v1.2.3