]> scripts.mit.edu Git - www/ikiwiki.git/blobdiff - IkiWiki/Plugin/tag.pm
refactor autofiles
[www/ikiwiki.git] / IkiWiki / Plugin / tag.pm
index 9e6f417bf712535b3192ddf84e0858a6af758121..7a918a4e847f4baa7a2ed4e87a3a9909f0e74066 100644 (file)
@@ -70,13 +70,13 @@ sub gentag ($) {
                my $tagfile = newpagefile(tagpage($tag), $config{default_pageext});
                $tagfile=~s/^\///;
 
-               return if (! add_autofile($tagfile, "tag"));
+               add_autofile($tagfile, sub {
+                       debug(sprintf(gettext("creating tag page %s"), $tag));
 
-               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);
+               });
        }
 }