]> sipb.mit.edu Git - ikiwiki.git/blob - IkiWiki/Setup/Standard.pm
There was a bug that [[inline archive="yes]] created an RSS link, but no feed.
[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 use warnings;
8 use strict;
9 use IkiWiki::Wrapper;
10 use IkiWiki::Render;
11
12 package IkiWiki::Setup::Standard;
13
14 sub import {
15         IkiWiki::setup_standard(@_);
16 }
17         
18 package IkiWiki;
19
20 sub setup_standard {
21         my %setup=%{$_[1]};
22
23         if (! $config{refresh}) {
24                 debug("generating wrappers..");
25                 my %startconfig=(%config);
26                 foreach my $wrapper (@{$setup{wrappers}}) {
27                         %config=(%startconfig, verbose => 0, %setup, %{$wrapper});
28                         checkconfig();
29                         gen_wrapper();
30                 }
31                 %config=(%startconfig);
32         }
33         foreach my $c (keys %setup) {
34                 $config{$c}=possibly_foolish_untaint($setup{$c})
35                         if defined $setup{$c} && ! ref $setup{$c};
36         }
37         if (! $config{refresh}) {
38                 $config{rebuild}=1;
39                 debug("rebuilding wiki..");
40         }
41         else {
42                 debug("refreshing wiki..");
43         }
44
45         checkconfig();
46         lockwiki();
47         loadindex();
48         refresh();
49
50         debug("done");
51         saveindex();
52 }
53
54 1