tag_autocreate => {
type => "boolean",
example => 0,
- description => "Autocreate new tag pages",
+ description => "autocreate new tag pages?",
safe => 1,
- rebuild => 1,
+ rebuild => undef,
},
}
sub gentag ($) {
my $tag=shift;
- if (defined $config{tag_autocreate} && $config{tag_autocreate}) {
+ if ($config{tag_autocreate}) {
my $tagfile = newpagefile(tagpage($tag), $config{default_pageext});
$tagfile=~s/^\///;
- return if (! add_autofile($tagfile, "tag"));
-
- debug(sprintf(gettext("creating tag page %s"), $tag));
+ add_autofile($tagfile, sub {
+ debug(sprintf(gettext("creating tag page %s"), $tag));
- my $template=template("autotag.tmpl");
- $template->param(tag => $tag);
- writefile($tagfile, $config{srcdir}, $template->output);
+ my $template=template("autotag.tmpl");
+ $template->param(tag => $tag);
+ writefile($tagfile, $config{srcdir}, $template->output);
+ });
}
}