Templates are moving into the srcdir, and will also be searched for in
configured underlays, so this is redundant.
safe => 0, # path
rebuild => 1,
},
- templatedirs => {
- type => "internal",
- default => [],
- description => "additional directories containing template files",
- safe => 0,
- rebuild => 0,
- },
underlaydir => {
type => "string",
default => "$installdir/share/ikiwiki/basewiki",
sub template_file ($) {
my $template=shift;
- foreach my $dir ($config{templatedir}, @{$config{templatedirs}},
+ foreach my $dir ($config{templatedir},
"$installdir/share/ikiwiki/templates") {
return "$dir/$template" if -e "$dir/$template";
}
safe => 0,
rebuild => 1,
},
- add_templates => {
- type => "string",
- example => ["$ENV{HOME}/.ikiwiki/templates"],
- description => "extra template directories to add",
- advanced => 1,
- safe => 0,
- rebuild => 1,
- },
}
sub checkconfig () {
add_underlay($dir);
}
}
- if ($config{add_templates}) {
- push @{$config{templatedirs}}, @{$config{add_templates}};
- }
}
1;
Directories in `add_underlays` should usually be absolute. If relative,
they're interpreted as relative to the parent directory of the basewiki
underlay, which is probably not particularly useful in this context.
-
---
-
-This plugin also adds an `add_templates` option to the setup file.
-Its value is a list of template directories to look for template files in,
-if they are not present in the `templatedir`.