summaryrefslogtreecommitdiff
path: root/IkiWiki/Setup/Standard.pm
blob: 4d1118f304b871024b93157a4c5fea941ed96cd9 (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. %::config=(%startconfig);
  19. ::debug("rebuilding wiki..");
  20. foreach my $c (keys %setup) {
  21. $::config{$c}=::possibly_foolish_untaint($setup{$c})
  22. if defined $setup{$c} && ! ref $setup{$c};
  23. }
  24. $::config{rebuild}=1;
  25. ::checkoptions();
  26. ::refresh();
  27. ::debug("done");
  28. ::saveindex();
  29. }
  30. 1