2 # Standard ikiwiki setup module.
3 # Parameters to import should be all the standard ikiwiki config stuff,
4 # plus an array of wrappers to set up.
11 package IkiWiki::Setup::Standard;
14 IkiWiki::setup_standard(@_);
22 $setup{plugin}=$config{plugin};
23 if (exists $setup{add_plugins}) {
24 push @{$setup{plugin}}, @{$setup{add_plugins}};
25 delete $setup{add_plugins};
27 if (exists $setup{disable_plugins}) {
28 foreach my $plugin (@{$setup{disable_plugins}}) {
29 $setup{plugin}=[grep { $_ ne $plugin } @{$setup{plugin}}];
31 delete $setup{disable_plugins};
34 if (! $config{refresh}) {
35 debug("generating wrappers..");
36 my @wrappers=@{$setup{wrappers}};
37 delete $setup{wrappers};
38 my %startconfig=(%config);
39 foreach my $wrapper (@wrappers) {
40 %config=(%startconfig, verbose => 0, %setup, %{$wrapper});
44 %config=(%startconfig);
47 delete $setup{wrappers};
50 foreach my $c (keys %setup) {
51 if (defined $setup{$c}) {
52 if (! ref $setup{$c}) {
53 $config{$c}=possibly_foolish_untaint($setup{$c});
55 elsif (ref $setup{$c} eq 'ARRAY') {
56 $config{$c}=[map { possibly_foolish_untaint($_) } @{$setup{$c}}]
64 if (! $config{refresh}) {
66 debug("rebuilding wiki..");
69 debug("refreshing wiki..");