summaryrefslogtreecommitdiff
path: root/IkiWiki/Setup/Standard.pm
blob: 76213b11aa2636987f3c669ae21379d984e767ff (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. foreach my $wrapper (@{$setup{wrappers}}) {
  13. %::config=(%::config, verbose => 0, %setup, %{$wrapper});
  14. ::checkoptions();
  15. ::gen_wrapper();
  16. }
  17. ::debug("rebuilding wiki..");
  18. foreach my $c (keys %setup) {
  19. $::config{$c}=::possibly_foolish_untaint($setup{$c})
  20. if defined $setup{$c} && ! ref $setup{$c};
  21. }
  22. $::config{rebuild}=1;
  23. ::checkoptions();
  24. ::refresh();
  25. ::debug("done");
  26. ::saveindex();
  27. }
  28. 1