X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fblosxom-plugins.git;a=blobdiff_plain;f=gavinc%2Ftags;h=5c5d8137805ed14e892e008987c16bd3cbe0cf0d;hp=0202f8550fe1ba3cac511a841c3a568eaf518025;hb=ad3af3cccc6f2e50b250bd3ca8d98e2a1a58e994;hpb=e1adedc9d0a948a755ac648befbf5a3415072e5a diff --git a/gavinc/tags b/gavinc/tags index 0202f85..5c5d813 100644 --- a/gavinc/tags +++ b/gavinc/tags @@ -25,6 +25,7 @@ my $tag_header = 'Tags'; my $tag_cache_file = "$blosxom::plugin_state_dir/tag_cache"; # --------------------------------- +# __END_CONFIG__ $tag_cache = {}; $tag_entries = {}; @@ -55,8 +56,18 @@ sub entries { # debug(3, "entries, path_info $path_info"); if ($path_info =~ m!^$tagroot/(.*)!) { + $blosxom::flavour = ''; my $taglist = $1; # debug(3, "entries, path_info matches tagroot (taglist $taglist)"); + + # Allow flavours appended to tags after a slash + # Dot-flavour versions are problematic, because tags can include dot e.g. web2.0 + if ($taglist =~ m! /(\w+)$ !x) { + $blosxom::flavour = $1; + $taglist =~ s! /$blosxom::flavour$ !!x; + } + + # Split individual tags out of taglist if ($taglist =~ m/;/) { @path_tags = split /\s*;\s*/, $taglist; $path_tags_op = ';'; @@ -67,6 +78,7 @@ sub entries { } # If $path_info matches $tagroot it's a virtual path, so reset $blosxom::path_info = ''; + $blosxom::flavour ||= $blosxom::default_flavour; } return 0; @@ -211,6 +223,25 @@ OR semantics. =back +Tag filtering also supports a trailing flavour after the taglist, +separated by a slash e.g. + + /tags/dogs/html + /tags/dogs,cats/rss + /tags/dogs;cats;pets/atom + +Note that this is different to L, which treats trailing +components as additional tags. + +At this point L don't support dot-flavour paths e.g. + + /tags/mysql.html + +The problem with this is that tags can include dots, so it's +ambiguous how to parse C, for instance. If you'd +like this supported and have suggestions about how to handle +the ambiguities, please get in touch. + =head1 USAGE L should be loaded early as it modifies blosxom $path_info when