turn on tag_autocreate by default if tagbase is set
authorJoey Hess <joey@kitenet.net>
Thu, 22 Apr 2010 00:39:20 +0000 (20:39 -0400)
committerJoey Hess <joey@kitenet.net>
Thu, 22 Apr 2010 00:39:20 +0000 (20:39 -0400)
IkiWiki/Plugin/tag.pm
debian/NEWS
doc/ikiwiki/directive/tag.mdwn
doc/plugins/tag.mdwn

index cd7ecc212fd7c928560ade98d34366ae9da45999..62f030f4eda9dd384b5127a0656eebc0170d6120 100644 (file)
@@ -36,7 +36,7 @@ sub getsetup () {
                },
                tag_autocreate => {
                        type => "boolean",
-                       example => 0,
+                       example => 1,
                        description => "autocreate new tag pages?",
                        safe => 1,
                        rebuild => undef,
@@ -67,7 +67,8 @@ sub htmllink_tag ($$$;@) {
 sub gentag ($) {
        my $tag=shift;
 
-       if ($config{tag_autocreate}) {
+       if ($config{tag_autocreate} ||
+           ($config{tagbase} && ! defined $config{tag_autocreate})) {
                my $tagpage=taglink($tag);
                if ($tagpage=~/^\.\/(.*)/) {
                        $tagpage=$1;
index 9fd882ad22f4d4b2dafeabda9332f374468fe76c..8b87bc601b97ca9e0c926263ca20091485845591 100644 (file)
@@ -11,6 +11,10 @@ ikiwiki (3.20100406) unstable; urgency=low
   not regular wikilinks. If your wiki accidentially relied on the old,
   buggy behavior, you might need to change pagespecs to use `link()`.
 
+  Tag pages can automatically be created as new tags are used. This
+  feature is enabled by default if you have configured a tagbase. It
+  can be turned on or off using the `tag_autocreate` setting.
+
   The title_natural sort method (as used by the inline directive, etc)
   have been moved to the new sortnaturally plugin, which is not enabled
   by default since it requires the Sort::Naturally perl module.
index 807a96f25b96ce5cff248d4001b8255f12d13559..c8d9b98169fd7055b71a785786f747fea2ebc7c7 100644 (file)
@@ -19,7 +19,8 @@ instead:
 Note that if the wiki is configured to use a tagbase, then the tags will be
 located under a base directory, such as "tags/". This is a useful way to
 avoid having to write the full path to tags, if you want to keep them
-grouped together out of the way.
+grouped together out of the way. Also, since ikiwiki then knows where to put
+tags, it will automatically create tag pages when new tags are used.
 
 Bear in mind that specifying a tagbase means you will need to incorporate it
 into the `link()` [[ikiwiki/PageSpec]] you use: e.g., if your tagbase is
index bdf39d7e89cc4bb7d94e48e9414d9992c0ef28e8..8e1286e6272b5adffc5598d88b529fc4dfcd5ab0 100644 (file)
@@ -8,8 +8,12 @@ These directives allow tagging pages.
 It also provides the `tagged()` [[ikiwiki/PageSpec]], which can be used to
 match pages that are tagged with a specific tag.
 
-If the `tag_autocreate` setting is enabled, tag pages will automatically be
-created as needed.
+The `tagbase` setting can be used to make tags default to being put in a
+particular subdirectory.
+
+The `tag_autocreate` setting can be used to control whether new tag pages
+are created as needed. It defaults to being done only if a `tagbase` is
+set.
 
 [[!if test="enabled(tag)" then="""
 This wiki has the tag plugin enabled, so you'll see a note below that this