summaryrefslogtreecommitdiff
path: root/IkiWiki/Setup/Standard.pm
blob: da712e94aa784ea482f622e35fd4632ec0223635 (plain)
  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. package IkiWiki::Setup::Standard;
  7. use warnings;
  8. use strict;
  9. sub import {
  10. my %setup=%{$_[1]};
  11. ::debug("generating wrappers..");
  12. my %startconfig=(%::config);
  13. foreach my $wrapper (@{$setup{wrappers}}) {
  14. %::config=(%startconfig, verbose => 0, %setup, %{$wrapper});
  15. ::checkoptions();
  16. ::gen_wrapper();
  17. }
  18. ::debug("rebuilding wiki..");
  19. foreach my $c (keys %setup) {
  20. $::config{$c}=::possibly_foolish_untaint($setup{$c})
  21. if defined $setup{$c} && ! ref $setup{$c};
  22. }
  23. $::config{rebuild}=1;
  24. ::checkoptions();
  25. ::refresh();
  26. ::debug("done");
  27. ::saveindex();
  28. }
  29. 1