At Branden's request, clean up the hardcoded ".ikiwiki" everywhere, and add
[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                 %::config=(%::config, verbose => 0, %setup, %{$wrapper});
18                 ::checkoptions();
19                 ::gen_wrapper();
20         }
21
22         ::debug("rebuilding wiki..");
23         foreach my $c (keys %setup) {
24                 $::config{$c}=::possibly_foolish_untaint($setup{$c})
25                         if defined $setup{$c} && ! ref $setup{$c};
26         }
27         $::config{rebuild}=1;
28         ::checkoptions();
29         ::refresh();
30
31         ::debug("done");
32         ::saveindex();
33 }
34
35 1