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