diff options
author | Joe Rayhawk <jrayhawk@cobain.omgwallhack.org> | 2010-07-03 18:26:00 -0700 |
---|---|---|
committer | Joe Rayhawk <jrayhawk@cobain.omgwallhack.org> | 2010-07-03 18:26:00 -0700 |
commit | 085c9eb95d5b559634a1751f55c21c546164b04f (patch) | |
tree | a0d1f978c2f54b375ab5ce770d35386935eed2d8 /notes/ikiwiki_setup_mangling.mdwn | |
parent | 1ccd3257e3819ed53a6e560a2442fc668fffeca1 (diff) | |
download | jrayhawk-085c9eb95d5b559634a1751f55c21c546164b04f.tar.gz jrayhawk-085c9eb95d5b559634a1751f55c21c546164b04f.zip |
Notes: ikiwiki setup mangling: new
Diffstat (limited to 'notes/ikiwiki_setup_mangling.mdwn')
-rw-r--r-- | notes/ikiwiki_setup_mangling.mdwn | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/notes/ikiwiki_setup_mangling.mdwn b/notes/ikiwiki_setup_mangling.mdwn new file mode 100644 index 0000000..cfc174c --- /dev/null +++ b/notes/ikiwiki_setup_mangling.mdwn @@ -0,0 +1,45 @@ +This is an example of how to take an Ikiwiki setup file and mangle it +programmatically. In my case, I'm running it on the fly for use with +`| sudo -u ikiwiki ikiwiki --setup - --rebuild --verbose` in order to strip out +the cgi-related functions. + + #!/usr/bin/perl + + use strict; + use warnings; + + package IkiWiki::Setup::Standard; + + $INC{"IkiWiki/Setup/Standard.pm"} = "/fake/path"; + + use Data::Dumper qw( ); + + sub import { + my ( $class, $config ) = @_; + + # foreach my $key ( grep { /^[^aeiou]/i } keys %{$config} ) { + # delete $config->{$key}; + # }; + + delete $config->{cgiurl}; + delete $config->{diffurl}; + delete $config->{historyurl}; + delete $config->{wrappers}; + + # delete cgi-relevant plugins + @{$config->{add_plugins}} = grep(!/^(wmd|httpauth)$/, @{$config->{add_plugins}}); + + push(@{$config->{disable_plugins}}, 'recentchanges'); + + $config->{destdir} = '/srv/www/www.tovatest.com'; + $config->{url} = 'http://www.tovacompany.com'; + + + my $newconfig = Data::Dumper->new( [ $config ] ); + $newconfig->Terse( 1 ); + + print "#!/usr/bin/perl\n\nuse IkiWiki::Setup::Standard " . $newconfig->Dump( ) . ";\n"; + + }; + + do "/srv/ikiwiki/tovawiki.setup"; |