summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/transient.pm
blob: 5764467ab0092827651f65b0485a96862e82c4ed (plain)
  1. #!/usr/bin/perl
  2. package IkiWiki::Plugin::transient;
  3. use warnings;
  4. use strict;
  5. use IkiWiki 3.00;
  6. sub import {
  7. hook(type => "getsetup", id => "transient", call => \&getsetup);
  8. hook(type => "checkconfig", id => "transient", call => \&checkconfig);
  9. }
  10. sub getsetup () {
  11. return
  12. plugin => {
  13. # this plugin is safe but only makes sense as a
  14. # dependency; similarly, it needs a rebuild but
  15. # only if something else does
  16. safe => 0,
  17. rebuild => 0,
  18. },
  19. }
  20. our $transientdir;
  21. sub checkconfig () {
  22. eval q{use Cwd 'abs_path'};
  23. error($@) if $@;
  24. $transientdir = abs_path($config{wikistatedir})."/transient";
  25. add_underlay($transientdir);
  26. }
  27. 1;