X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fblosxom-plugins.git;a=blobdiff_plain;f=gavinc%2Fstorytags;fp=gavinc%2Fstorytags;h=e1426a8b1b901c222dfe275dc55f6183e25f3c9e;hp=1665dbf5fb11e39074cf901a0210844b4d1133a0;hb=1c2ded0e43a7f208694862d89c38f8c83688ff61;hpb=d3f68ae80b1153a95e918c057b6304063797efc3 diff --git a/gavinc/storytags b/gavinc/storytags index 1665dbf..e1426a8 100644 --- a/gavinc/storytags +++ b/gavinc/storytags @@ -1,6 +1,6 @@ # Blosxom Plugin: storytags # Author(s): Gavin Carr -# Version: 0.002000 +# Version: 0.003000 # Documentation: See the bottom of this file or type: perldoc storytags # Requires: tags # Follows: tags @@ -12,13 +12,15 @@ use strict; # Uncomment next line to enable debug output (don't uncomment debug() lines) #use Blosxom::Debug debug_level => 1; -use vars qw($taglist @taglist); +use vars qw(%config $taglist @taglist); # --- Configuration variables ----- +%config = (); + # Formatting strings -my $prefix = 'Tags: '; -my $suffix = '. '; +$config{prefix} = 'Tags: '; +$config{suffix} = '. '; # --------------------------------- # __END_CONFIG__ @@ -48,12 +50,12 @@ sub story { sub _format_taglist { my ($tags) = @_; return '' unless @$tags; - return $prefix + return $config{prefix} . join(', ', map { qq() } @$tags ) - . $suffix; + . $config{suffix}; } 1; @@ -70,12 +72,12 @@ and @storytags::taglist array of tags L is a blosxom plugin to format a per-story $storytags::taglist string, and a @storytags::taglist array of tags. The $taglist is a comma-separated list of the tags defined for the story, prefixed by -$storytags::prefix, and suffixed by $storytags::suffix. If no tags are +$config{prefix}, and suffixed by $config{suffix}. If no tags are defined, then $taglist will be the empty string '' (i.e. no prefix and suffix are added). @taglist is a simple array of the tags for the story, and an empty array if none are set. -The default values for $prefix and $suffix are 'Tags: ' and '. ' +The default values for 'prefix' and 'suffix' are 'Tags: ' and '. ' respectively, so a typical $taglist might look like: Tags: dogs, cats, pets.