X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fblosxom-plugins.git;a=blobdiff_plain;f=gavinc%2Ftags;fp=gavinc%2Ftags;h=9282ea2bdd08e9d48df3b88d9727ef38d41afcb4;hp=0202f8550fe1ba3cac511a841c3a568eaf518025;hb=b4d0840a866dec5cdc609b4a7feddf4f74bc182d;hpb=e1adedc9d0a948a755ac648befbf5a3415072e5a diff --git a/gavinc/tags b/gavinc/tags index 0202f85..9282ea2 100644 --- a/gavinc/tags +++ b/gavinc/tags @@ -55,8 +55,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 +77,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 +222,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