blob: 02debbede1d8145222a460d51536ac9e68c277f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
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 - --refresh --verbose` in order to strip out
the cgi-related functions. In the future, I think it would be better to have dev and live on different git branches and have one Ikiwiki setup for each.
#!/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|attachment|rename|remove|search)$/, @{$config->{add_plugins}});
push(@{$config->{disable_plugins}}, 'recentchanges');
$config->{destdir} = '/srv/www/www.tovatest.com';
$config->{url} = 'http://www.tovacompany.com';
$config->{wikistatedir} = '/srv/ikiwiki/tovawiki/.ikiwiki-live';
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";
|