aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-04-21 20:39:20 -0400
committerJoey Hess <joey@kitenet.net>2010-04-21 20:39:20 -0400
commitd048e9c64aca24b8e064aaf1608862b50c427de2 (patch)
tree5c26287630b54989e3fa40d6ec2a1d7d19da4966
parent318134174f62a598ae77e2e50f53518fbd673a19 (diff)
downloadikiwiki-d048e9c64aca24b8e064aaf1608862b50c427de2.tar
ikiwiki-d048e9c64aca24b8e064aaf1608862b50c427de2.tar.gz
turn on tag_autocreate by default if tagbase is set
-rw-r--r--IkiWiki/Plugin/tag.pm5
-rw-r--r--debian/NEWS4
-rw-r--r--doc/ikiwiki/directive/tag.mdwn3
-rw-r--r--doc/plugins/tag.mdwn8
4 files changed, 15 insertions, 5 deletions
diff --git a/IkiWiki/Plugin/tag.pm b/IkiWiki/Plugin/tag.pm
index cd7ecc212..62f030f4e 100644
--- a/IkiWiki/Plugin/tag.pm
+++ b/IkiWiki/Plugin/tag.pm
@@ -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;
diff --git a/debian/NEWS b/debian/NEWS
index 9fd882ad2..8b87bc601 100644
--- a/debian/NEWS
+++ b/debian/NEWS
@@ -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.
diff --git a/doc/ikiwiki/directive/tag.mdwn b/doc/ikiwiki/directive/tag.mdwn
index 807a96f25..c8d9b9816 100644
--- a/doc/ikiwiki/directive/tag.mdwn
+++ b/doc/ikiwiki/directive/tag.mdwn
@@ -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
diff --git a/doc/plugins/tag.mdwn b/doc/plugins/tag.mdwn
index bdf39d7e8..8e1286e62 100644
--- a/doc/plugins/tag.mdwn
+++ b/doc/plugins/tag.mdwn
@@ -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