fixes
[ikiwiki.git] / IkiWiki / Setup / Standard.pm
1 #!/usr/bin/perl
2 # Standard ikiwiki setup module.
3 # Parameters to import should be all the standard ikiwiki config stuff,
4 # plus hashes for cgiwrapper and svnwrapper, which specify any differing
5 # config stuff for them and cause the wrappers to be made.
6
7 package IkiWiki::Setup::Standard;
8
9 use warnings;
10 use strict;
11
12 sub import {
13         my %setup=%{$_[1]};
14
15         ::debug("generating wrappers..");
16         foreach my $wrapper (@{$setup{wrappers}}) {
17                 ::gen_wrapper(%::config, verbose => 0, %setup, %{$wrapper});
18         }
19
20         ::debug("rebuilding wiki..");
21         foreach my $c (keys %setup) {
22                 $::config{$c}=::possibly_foolish_untaint($setup{$c})
23                         if defined $setup{$c} && ! ref $setup{$c};
24         }
25         $::config{rebuild}=1;
26         ::refresh();
27
28         ::debug("done");
29         ::saveindex();
30 }
31
32 1