summaryrefslogtreecommitdiff
path: root/IkiWiki/Setup/Standard.pm
blob: 56ed5ab3b553e7f17b3b257cc82ee94049821770 (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. checkconfig();
  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. checkconfig();
  32. lockwiki();
  33. refresh();
  34. debug("done");
  35. saveindex();
  36. }
  37. 1