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