config files now based on perl modules
[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
16         ::debug("generating wrappers..");
17         foreach my $wrapper (@{$setup{wrapper}}) {
18                 ::gen_wrapper(%::config, %setup, %{$wrapper});
19         }
20
21         ::debug("rebuilding wiki..");
22         foreach my $c (keys %setup) {
23                 $::config{$c}=::possibly_foolish_untaint($setup{$c})
24                         if defined $setup{$c} && ! ref $setup{$c};
25         }
26         $::config{rebuild}=1;
27         ::refresh();
28
29         ::debug("done");
30         ::saveindex();
31 }
32
33 1