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